Function to estimate the case rate for a given variable, stratified by given variables, dependant on age, year, agegrp2, and uk birth status. Missing data for the rate variable is dropped.

case_rate(df, rate_for, strat_by = NULL, age_split = NULL,
  CoB_split = TRUE, Year_strat = TRUE)

Arguments

df

A dataframe in the format of the ETS

rate_for

A character string of the variable to calculate the rate for.

strat_by

A character string of the variables to stratfy by.

age_split

A character strig og the age split to stratify case counts by.

CoB_split

A logical indicating if Country of birth should be used to split the case counts.

Year_strat

A logical indicating if year should be stratified over.

Value

Returns a dataframe of case rates stratified by multiple variables with confidence intervals.

Examples