indirect_adjust | R Documentation |
Find standardized incidence ratios and standardized mortality ratios with indirect adjustment.
indirect_adjust( df, study_count, study_pop, ref_count, ref_pop, level = 95, decimals = 2 )
df |
A data frame. |
study_count |
Number of events in study group. |
study_pop |
Number of person-years at risk in study group. |
ref_count |
Number of events in referent group. |
ref_pop |
Number of person-years at risk in referent group. |
level |
Confidence level as percentage. |
decimals |
Number of decimal places in expected counts, SIR's and confidence intervals. |
A data table with the following fields:
observed
Number of events in study group
expected
Number of events expected in study group based on rate in referent group
sir
SIR: Standardized incidence (or mortality) ratio
sir_lci
Lower confidence limit of SIR using method of Garwood (1936)
sir_uci
Upper confidence limit of SIR by Garwood
Garwood F (1936) Fiducial limits for the Poisson distribution, Biometrika 28:437-442.
# standardized incidence ratio of US cancer incidence for males # compared to females library(dplyr) sir_by_year <- cancer %>% group_by(Year) %>% group_modify(~ reshape_for_SIR(.x, agegroup, Sex, "Male", n, pop)) %>% group_modify(~ indirect_adjust(.x, study_count, study_pop, ref_count, ref_pop))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.