| Title: | Tools for Direct Standardisation with Confidence Intervals |
|---|---|
| Description: | Provides tools to compute directly standardised rates using the 2013 European Standard Population for age and deprivation-standardised rates using a 10% per decile assumption. Sex standardisation uses an assumed equal proportion of both males and females. The package Includes variance estimation and 95% confidence intervals for population health applications. Functions support flexible grouping variables and age bands, enabling reproducible and automated analyses. |
| Authors: | Joe Blackford [aut, cre] |
| Maintainer: | Joe Blackford <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.2 |
| Built: | 2026-10-11 15:16:58 UTC |
| Source: | https://github.com/joeblackford/epistandardiser |
Computes directly age and deprivation standardised rates with 95% confidence intervals using the 2013 European Standard Population with an equal 10% distribution across deprivation deciles. Confidence intervals are calculated using Byar's method. Lower confidence interval limits below zero are reported as zero.
direct_age_dep_standardise( data, var, ageband, deprivation, observed, population, multiplier = 1000 )direct_age_dep_standardise( data, var, ageband, deprivation, observed, population, multiplier = 1000 )
data |
Dataframe containing observed counts and population. |
var |
One or more grouping variables (quoted or unquoted). |
ageband |
Column specifying age bands. |
deprivation |
Column specifying deprivation deciles. |
observed |
Column containing observed counts. |
population |
Column containing denominator population. |
multiplier |
Scale for rates (default = 1,000). |
A tibble containing the grouping variables, total observed events, total population, crude rate, age- and deprivation- standardised rate, and 95% confidence intervals.
example_data <- data.frame( variable = c("A", "A", "A", "A"), ageband = c("0-4", "0-4", "5-9", "5-9"), deprivation = c(1, 2, 1, 2), observed = c(10, 12, 20, 22), population = c(1000, 1100, 1200, 1300) ) direct_age_dep_standardise( data = example_data, var = "variable", ageband = "ageband", deprivation = "deprivation", observed = "observed", population = "population" )example_data <- data.frame( variable = c("A", "A", "A", "A"), ageband = c("0-4", "0-4", "5-9", "5-9"), deprivation = c(1, 2, 1, 2), observed = c(10, 12, 20, 22), population = c(1000, 1100, 1200, 1300) ) direct_age_dep_standardise( data = example_data, var = "variable", ageband = "ageband", deprivation = "deprivation", observed = "observed", population = "population" )
Computes directly age- and sex-standardised rates with 95% confidence intervals using the 2013 European Standard Population with a 50:50 male/female distribution within each age band. Confidence intervals are calculated using Byar's method. Lower confidence interval limits below zero are reported as zero.
direct_age_sex_standardise( data, var, ageband, sex, observed, population, multiplier = 1000 )direct_age_sex_standardise( data, var, ageband, sex, observed, population, multiplier = 1000 )
data |
Dataframe containing observed counts and population. |
var |
One or more grouping variables (quoted or unquoted). |
ageband |
Column specifying age bands. |
sex |
Column specifying sex categories. |
observed |
Column containing observed counts. |
population |
Column containing denominator population. |
multiplier |
Scale for rates (default = 1,000). |
A tibble containing the grouping variables, total observed events, total population, crude rate, age- and sex-standardised rate, and 95% confidence intervals.
example_data <- data.frame( variable = c("A", "A", "A", "A"), ageband = c("0-4", "0-4", "5-9", "5-9"), sex = c("F", "M", "F", "M"), observed = c(10, 12, 20, 22), population = c(1000, 1100, 1200, 1300) ) direct_age_sex_standardise( data = example_data, var = "variable", ageband = "ageband", sex = "sex", observed = "observed", population = "population" )example_data <- data.frame( variable = c("A", "A", "A", "A"), ageband = c("0-4", "0-4", "5-9", "5-9"), sex = c("F", "M", "F", "M"), observed = c(10, 12, 20, 22), population = c(1000, 1100, 1200, 1300) ) direct_age_sex_standardise( data = example_data, var = "variable", ageband = "ageband", sex = "sex", observed = "observed", population = "population" )
Computes directly age-standardised rates with 95% confidence intervals using the 2013 European Standard Population and Byar’s method.
Computes directly age-standardised rates with 95% confidence intervals using the 2013 European Standard Population and Byar's method.
direct_age_standardise( data, var, ageband, observed, population, multiplier = 1000 ) direct_age_standardise( data, var, ageband, observed, population, multiplier = 1000 )direct_age_standardise( data, var, ageband, observed, population, multiplier = 1000 ) direct_age_standardise( data, var, ageband, observed, population, multiplier = 1000 )
data |
Dataframe with observed values and population. |
var |
One or more grouping variables (quoted or unquoted). |
ageband |
Column specifying age bands. |
observed |
Column with observed counts. |
population |
Column with denominator population. |
multiplier |
Scale for rates (default = 1,000). |
A tibble with directly standardised rates and 95% confidence intervals
A tibble with directly standardised rates and 95% confidence intervals.
example_data <- data.frame( variable = c("A", "A", "B", "B"), ageband = c("0-4", "5-9", "0-4", "5-9"), observed = c(10, 20, 15, 25), population = c(1000, 1200, 1100, 1300) ) direct_age_standardise( data = example_data, var = "variable", ageband = "ageband", observed = "observed", population = "population" ) example_data <- data.frame( variable = c("A", "A", "B", "B"), ageband = c("0-4", "5-9", "0-4", "5-9"), observed = c(10, 20, 15, 25), population = c(1000, 1200, 1100, 1300) ) direct_age_standardise( data = example_data, var = "variable", ageband = "ageband", observed = "observed", population = "population" )example_data <- data.frame( variable = c("A", "A", "B", "B"), ageband = c("0-4", "5-9", "0-4", "5-9"), observed = c(10, 20, 15, 25), population = c(1000, 1200, 1100, 1300) ) direct_age_standardise( data = example_data, var = "variable", ageband = "ageband", observed = "observed", population = "population" ) example_data <- data.frame( variable = c("A", "A", "B", "B"), ageband = c("0-4", "5-9", "0-4", "5-9"), observed = c(10, 20, 15, 25), population = c(1000, 1200, 1100, 1300) ) direct_age_standardise( data = example_data, var = "variable", ageband = "ageband", observed = "observed", population = "population" )
Computes directly deprivation-standardised rates with 95% confidence intervals using a standard national deprivation profile with equal population in each deprivation decile and Byar’s method.
direct_dep_standardise( data, var, dep_decile, observed, population, multiplier = 1000 )direct_dep_standardise( data, var, dep_decile, observed, population, multiplier = 1000 )
data |
Data frame containing observed counts and population denominators |
var |
One or more grouping variables (quoted or unquoted) |
dep_decile |
Column specifying deprivation deciles (1–10) |
observed |
Column with observed counts |
population |
Column with denominator population |
multiplier |
Scale for rates (default = 1,000) |
A tibble with deprivation-standardised rates and 95% confidence intervals
example_data <- data.frame( group = c("A", "A", "B", "B"), dep_decile = factor(c(1, 2, 1, 2)), observed = c(10, 20, 15, 25), population = c(1000, 1200, 1100, 1300) ) direct_dep_standardise( data = example_data, var = "group", dep_decile = "dep_decile", observed = "observed", population = "population" )example_data <- data.frame( group = c("A", "A", "B", "B"), dep_decile = factor(c(1, 2, 1, 2)), observed = c(10, 20, 15, 25), population = c(1000, 1200, 1100, 1300) ) direct_dep_standardise( data = example_data, var = "group", dep_decile = "dep_decile", observed = "observed", population = "population" )
A dataset containing abridged ESP 2013 standard population counts for use in age standardisation.
ref_populationref_population
A data frame with 19 rows and 2 variables:
Age group (character, e.g. "0-4", "5-9")
Standard population count for that age band
Eurostat ESP 2013
A reference population derived from the 2013 European Standard Population, assigning equal weight to each deprivation decile within each age band. This reference population can be used for direct age and deprivation standardisation.
std_age_depstd_age_dep
A data frame with age- and deprivation-specific standard population weights:
Age band from the European Standard Population
Deprivation decile
Standard population weight
Derived from the 2013 European Standard Population using an equal 10% distribution across deprivation deciles.
A reference population derived from the European Standard Population, assigning equal weight to females and males within each age band. This 50:50 distribution can be used for direct age and sex standardisation.
std_age_sexstd_age_sex
A data frame with age and sex-specific standard population weights:
Age band from the European Standard Population
Sex category
Standard population weight
Derived from the European Standard Population using a 50:50 female/male distribution.
Reference population weights for deprivation decile standardisation. Assumes an equal 10 percent population distribution across deprivation deciles.
std_dep_decilestd_dep_decile
A data frame with 10 rows and 2 variables:
Deprivation decile
Standard population weight
Internal package dataset
A reference population assigning equal weight to females and males. This 50:50 distribution can be used for direct sex standardisation.
std_sexstd_sex
A data frame with 2 rows and 2 variables:
Sex category
Standard population weight
Reference distribution defined for the epistandardiser package.