Description Usage Arguments Value Examples
st_rate calculates direct standardized mortality rates and the 95% or 99% confidence intervals.
Default standardization uses the 2013 European Standard Population, but other built-in or user supplied
weights can also be supplied.
1 2 3 4 5 6 7 8 9 10 11 12  | 
data | 
 Name of data set.  | 
health | 
 Health outcome of interest.  | 
population | 
 Population counts. Should correspond to data provided in   | 
ses | 
 Categorical deprivation measure used for splitting the data.  | 
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).  | 
groups | 
 Conditions such as sex or ethnicity that together define the sub-population for which the
rates are calculated for. Default is   | 
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
  | 
st_pop | 
 The standard population weights used for calculating rates, default 2013 ESP for 18 age groups with 0-4 as
the first age group. See   | 
CI | 
 Confidence intervals, 95 by default but can be set to any number between 0 and 100.  | 
total | 
 The total number of people in the standard population, i.e. are rates be calculated per 1000 or 100 000, default 1000  | 
A data frame giving standardized rates by age group and deprivation together with CI.
1 2 3 4 5 6 7 8 9 10 11  | d <- health_data
# Standardized rates for all people
st_rate(d, bad, pop, quintile, age, ethnicity == "all")
# Or save results
rate_data <- st_rate(d, bad, pop, quintile, age, ethnicity == "all")
# Then use View(rate_data) to view results
# Standardized rates for Scottish, with 99% CI
st_rate(d, bad, pop, quintile, age, ethnicity == "Scot", 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.