Description Usage Arguments Value Examples
The function smr
calculates standardized mortality ratios (SMR) and confidence intervals for SMR.
1 |
data |
Name of data set. |
health |
Health outcome of interest. |
population |
Population counts. Should correspond to data provided in |
age |
Variable that defines 5-year age groups, should be ordered and numeric, such as 1 through 18. If the age group coding starts with 0 it will be assumed that age groups 0 and 1-4 are separate. If the age group starts with 1, it will be assumed that the first age group is 0-4 (ages 0 and 1-4 are combined). |
compare |
Categorical variable that splits the data into groups that are to be compared, such as ethnicity. |
sets |
Groups that are to be compared (values taken by |
age_group |
The age groups the standardized rates should be calculated for. By default the function calculates
results for the following age groups: 0-14, 15-29, 30-44, 45-59, 60-74, 75+, 0-64 and all ages.
User supplied age groups should be provided using the standard population groups as cut-offs, e.g. use
|
CI |
Confidence intervals, 95 by default but can be set to any number between 0 and 100. For calculation method see user guide. |
A data frame of standardized mortality ratios (SMR) and CIs.
1 2 3 4 5 6 7 8 | d <- health_data
# Asian population compared to Scottish (reference)
smr(d, bad, pop, age, ethnicity, sets = c("Scot", "asian"))
# Asian, White British and Irish population compared to Scottish (reference)
smr(d, bad, pop, age, ethnicity, sets = c("Scot", "asian", "WB", "Irish"),
age_group = c("15-29", "30-44"), CI = 99)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.