est_attrib {attrib} | R Documentation |
Estimates simulations of expected responses
Description
For each exposure the dataset is copied and the original value replaced by the reference value. Then the sim function is used to generate 500 simulations of expected responses for each row. Finally the dataset is transformed to obtain expected response for original and reference values of the given exposures for each original row of the dataset.
Usage
est_attrib(fit, data, exposures, n_sim = 500)
Arguments
fit |
A model fit constructed by fit_attrib |
data |
The observed data |
exposures |
The exposures that will get reference expected mortalities |
n_sim |
Number of simulations For more details see the help vignette:
|
Details
The burden method is based on Nielsen, Krause, Molbak <doi:10.1111/irv.12564>.
For more details see the help vignette:
vignette("intro", package="attrib")
Value
Dataset with expected responses for all simulations including expected responses given the exposure reference values
Examples
response <- "deaths"
fixef <- "pr100_ili_lag_1 + sin(2 * pi * (week - 1) / 52) + cos(2 * pi * (week - 1) / 52)"
ranef <- " (pr100_ili_lag_1| season)"
offset <- "log(pop)"
data <- attrib::data_fake_nation
fit <- fit_attrib(data = data, response = response, fixef = fixef, ranef = ranef, offset = offset)
exposures <- c(pr100_ili_lag_1 = 0)
n_sim <- 5
new_data <- est_attrib(fit, data, exposures, n_sim)
new_data[]