`R/upper_limit.R`

`upper_risk_difference.Rd`

These functions calculate sample size based on probability that upper limit is below level of concern. The idea behind this approach is to use precision to provide support for the absence of effect. These functions calculate sample size where, when the true effect is null, the upper limit of the confidence interval of the estimate of interest has a probability of being at or under a specified level of concern.

upper_risk_difference( upper_limit, prob, exposed, unexposed, group_ratio, ci = 0.95 ) upper_risk_ratio(upper_limit, prob, exposed, unexposed, group_ratio, ci = 0.95) upper_rate_difference( upper_limit, prob, exposed, unexposed, group_ratio, ci = 0.95 ) upper_rate_ratio(upper_limit, prob, exposed, unexposed, group_ratio, ci = 0.95) upper_odds_ratio( upper_limit, prob, exposed_cases, exposed_controls, group_ratio, ci = 0.95 )

upper_limit | The upper limit of the confidence interval, a level of concern. |
---|---|

prob | The probability of the estimated upper limit of the confidence interval being at or below the level of concern. |

exposed | The risk or rate among the exposed cohort. |

unexposed | The risk or rate among the unexposed cohort. |

group_ratio | In cohort studies, the ratio of the unexposed to the exposed. In case-control studies, the ratio of the controls to the cases. |

ci | The confidence interval as a probability or percent. Default is .95. |

exposed_cases | The proportion of exposed cases. |

exposed_controls | The proportion of exposed controls. |

a tibble with sample size, effect measure, upper limit, and probability

Rothman, K.J. and Greenland, S. 2018. Planning Study Size Based on Precision Rather Than Power. 29(5):599-603.

# From Rothman and Greenland 2018 upper_rate_ratio( upper_limit = 2, prob = .90, exposed = .01, unexposed = .01, group_ratio = 1 )#> # A tibble: 1 × 10 #> n_exposed n_unexposed n_total rate_ratio upper_limit prob exposed unexposed #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 4374. 4374. 8748. 1 2 0.9 0.01 0.01 #> # … with 2 more variables: group_ratio <dbl>, ci <dbl>