Learn R Programming

directAgeStd (version 0.0.2)

direct_age_standardise: Direct Age Standardisation with Confidence Intervals

Description

Computes directly age-standardised rates with 95% confidence intervals using the 2013 European Standard Population and Byar’s method.

Usage

direct_age_standardise(
  data,
  var,
  ageband,
  observed,
  population,
  multiplier = 1000
)

Value

A tibble with directly standardised rates and 95% confidence intervals

Arguments

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)

Examples

Run this code
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"
)

Run the code above in your browser using DataLab