rate_adj_indirect {tidyrates} | R Documentation |
Compute direct adjusted rates with tibbles
Description
Computes indirect adjusted rates and confidence intervals.
Usage
rate_adj_indirect(
.data,
.std,
.keys = NULL,
.name_var = "name",
.value_var = "value",
.age_group_var = "age_group",
.age_group_pop_var = "population",
.events_label = "events",
.population_label = "population",
.progress = TRUE
)
Arguments
.data |
A tibble containing events counts and population per groups (e.g. age groups) |
.std |
A vector with standard population values for each group |
.keys |
Optional. A character vector with grouping variables, like year and region code. |
.name_var |
Variable containing variable names. Defaults to |
.value_var |
Variable containing values. Defaults to |
.age_group_var |
Variable name of age groups. Defaults to |
.age_group_pop_var |
Variable name of population size on |
.events_label |
Label used for events at the |
.population_label |
Label used for population at the |
.progress |
Whether to show a progress bar. Defaults to |
Details
This functions wraps the epitools
ageadjust.indirect function to compute indirect adjusted rates and "exact" confidence intervals using tibble
objects with multiple grouping keys.
A tibble (.data
) must be informed containing key variables like year and region code, and population and and events count (e.g. cases) per age group. Check the fleiss_data
for an example.
A tibble (.std
) must be also supplied containing the age groups, events and population size. By default, this tibble has three variables, named age_group
, name
and value
. Check the selvin_data_1940
for an example.
Value
A tibble with crude and adjusted rate, lower and upper confidence intervals.
Examples
rate_adj_indirect(.data = selvin_data_1960, .std = selvin_data_1940)