distill {paramix} | R Documentation |
Distill Outcomes
Description
distill
takes a low-age resolution outcome, for example deaths,
and proportionally distributes that outcome into a higher age resolution for
use in subsequent analyses like years-life-lost style calculations.
Usage
distill(alembic_dt, outcomes_dt, groupcol = names(outcomes_dt)[1])
Arguments
alembic_dt |
an |
outcomes_dt |
a long-format |
groupcol |
a string, the name of the outcome model group column. The
|
Details
When the value
column is re-calculated, note that it will aggregate all
rows with matching groupcol
entries in outcomes_dt
. If you need to group
by other features in your input data (e.g. if you need to distill outcomes
across multiple simulation outputs or at multiple time points), that has to
be done by external grouping then calling distill()
.
Value
a data.frame
, with output_partition
and recalculated value
column
Examples
ifr_levin <- function(age_in_years) {
(10^(-3.27 + 0.0524 * age_in_years))/100
}
age_limits <- c(seq(0, 69, by = 5), 70, 80, 101)
age_pyramid <- data.frame(
from = 0:101, weight = ifelse(0:101 < 65, 1, .99^(0:101-64))
)
age_pyramid$weight[102] <- 0
# flat age distribution, then 1% annual deaths, no one lives past 101
alembic_dt <- alembic(ifr_levin, age_pyramid, age_limits, 0:101)
results <- data.frame(model_partition = head(age_limits, -1))
results$value <- 10
distill(alembic_dt, results)