Description Usage Arguments Value References Examples

These functions calculate the precision of an estimate given a certain sample size. For ratio measures, like the risk ratio, rate ratio, and odds ratio, this is the ratio of the upper to lower limit of the confidence interval. For difference measures, like the risk difference or rate difference, this is the absolute width of the confidence interval.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ```
precision_risk_difference(
n_exposed,
exposed,
unexposed,
group_ratio,
ci = 0.95
)
precision_risk_ratio(n_exposed, exposed, unexposed, group_ratio, ci = 0.95)
precision_rate_difference(
n_exposed,
exposed,
unexposed,
group_ratio,
ci = 0.95
)
precision_rate_ratio(n_exposed, exposed, unexposed, group_ratio, ci = 0.95)
precision_odds_ratio(
n_cases,
exposed_cases,
exposed_controls,
group_ratio,
ci = 0.95
)
``` |

`n_exposed, n_cases` |
In cohort studies, the number of exposed participants. In case-control studies, the number of cases. |

`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 precision, effect measure, and sample size

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

1 2 3 4 5 6 7 8 | ```
# From Rothman and Greenland 2018
precision_odds_ratio(
n_cases = 500,
exposed_cases = .6,
exposed_controls = .4,
group_ratio = 2
)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.