Giter Site home page Giter Site logo

episheet's Introduction

Hi there ๐Ÿ‘‹

My ๐ŸŒ is at epijim.uk

I run a cron job that makes commits - so my streak is not human in nature... (I should probably make a bot account)

GitHub Streak

visitors

episheet's People

Contributors

epijim avatar romainfrancois avatar simonthelwall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

episheet's Issues

Consider adding function(s) to do standardisation

Problem statement

Ken Rothman's episheet has a tab for calculating standardised rates and proportions. This package has no such functions.

Proposed solution

Add one or more functions to calculate standardised rates and proportions.
See Ch. 15 from p265 of 2nd Ed Modern Epidemiology.
It should fit with tidyverse so that can do grouped calculations.
Table 15-2, p268 has sample data (which I think already exists in package?), same as on standardisation tab in Excel episheet.

Redundant ci_level argument in risk function.

Using example data in package help

dat <- data.frame(
    exposure_var = c(rep(1, 8), rep(0, 5), rep(1, 98), rep(0, 115)),
  outcome_var = c(rep(1, 8), rep(1, 5), rep(0, 98), rep(0, 115)),
  stringsAsFactors = FALSE
) 

Output with default ci_level

> risk(data = dat, exposure = exposure_var, outcome = outcome_var)

## # A tibble: 2 x 10
##  exposure_var     n outcome  risk risk_ratio rr_lci rr_uci risk_diff rd_lci rd_uci
##         <dbl> <int>   <dbl> <dbl>      <dbl>  <dbl>  <dbl>     <dbl>  <dbl>  <dbl>
## 1            0   120       5  4.17       1     0.337   2.96      0     -6.20   6.20
## 2            1   106       8  7.55       1.81  0.611   5.37      3.38  -2.82   9.58

Output with ci_level set to 99

> risk(data = dat, exposure = exposure_var, outcome = outcome_var,ci_level = 99)
## # A tibble: 2 x 10
##   exposure_var     n outcome  risk risk_ratio rr_lci rr_uci risk_diff rd_lci rd_uci
##          <dbl> <int>   <dbl> <dbl>      <dbl>  <dbl>  <dbl>     <dbl>  <dbl>  <dbl>
## 1            0   120       5  4.17       1     0.337   2.96      0     -6.20   6.20
## 2            1   106       8  7.55       1.81  0.611   5.37      3.38  -2.82   9.58

I believe the line that reads z <- abs(qnorm(((100 - 95)/2)/100)) in the function should be z <- abs(qnorm(((100 - ci_level)/2)/100)). Editing the function as such produces different confidence limits when ci_level is set.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.