standardize {surveil} | R Documentation |
Age-standardized rates
Description
Convert surveil
model results to age standardized rates using a fixed age distribution
Usage
standardize(x, label, standard_pop)
Arguments
x |
A fitted |
label |
Labels (character strings) for the age groups that correspond to the values of |
standard_pop |
Standard population values corresponding to the age groups specified by |
Value
A list, also of class "stand_surveil", containing the entire contents of the user-provided surveil
model plus the following:
- standard_summary
summary data frame of standardized rates (means and 95 percent credible intervals)
- standard_samples
a data frame of Markov chain Monte Carlo (MCMC) samples from the posterior probability distribution for the standardized rates
- standard_label
user-provided age-group labels
- standard_pop
user-provided standardized population sizes (ordered as
standard_label
)
See Also
vignette("age-standardization", package = "surveil")
stan_rw
plot.stand_surveil
print.stand_surveil
Examples
data(cancer)
data(standard)
head(standard)
head(cancer)
cancer2 <- subset(cancer, grepl("55-59|60-64|65-69", Age))
fit <- stan_rw(cancer2, time = Year, group = Age,
chains = 2, iter = 1e3) # for speed only
stands <- standardize(fit,
label = standard$age,
standard_pop = standard$standard_pop)
print(stands)
plot(stands, style = "lines")