rate_difference | R Documentation |
Calculates a 95 percent confidence interval for a rate difference. Uses Kirkwood and Sterne's formula for a rate difference, p241 of 2nd Ed. I think this could be re-written to work better so that it takes a data.frame as an input and compares against a given baseline.
rate_difference(numerator1, denominator1, numerator2, denominator2)
numerator1 |
The numerator for the first level for comparison (e.g. the unexposed group) |
denominator1 |
The denominator for the first level for comparison |
numerator2 |
The numerator for the second level for comparison (e.g. the exposed group) |
denominator2 |
The denominator for the second level for comparison |
A dataframe with columns for rate difference, upper and lower confidence intervals
rate_difference(33, 355, 24, 518) # matches output from p241 K&S, 2nd Ed
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.