Estimate yearly age-specific mortality rates (ASMR) from a SOCSIM-generated population file
Source:R/estimate_rates.R
estimate_mortality_rates.Rd
Given a population file ('opop') generated by rsocsim, the function estimates (yearly) age-specific mortality rates.
Usage
estimate_mortality_rates(
opop,
final_sim_year,
year_min,
year_max,
year_group,
age_max_mort,
age_group
)
Arguments
- opop
An R object from SOCSIM microsimulation output (population file).
- final_sim_year
numeric. Final simulated year in 'real world' time ( used to convert 'SOCSIM time' to 'real world' time.)
- year_min
numeric. Lower-bound year for which rate should be estimated.
- year_max
numeric. Upper-bound year for which rate should be estimated.
- year_group
numeric. Size of year groups to estimate rate (year_group=1 will produce single-year estimates)
- age_max_mort
numeric. Maximum age for estimating mortality.
- age_group
numeric. Size of age groups to estimate rate (age_group=1 will produce single-age estimates)
Details
The final_sim_year
can be obtained from the .sup file and must
refer to to a real-world year.
Grouped year and age ranges (i.e., if year_group > 1
or age_group > 1
)
are created as [year;year+year_group). Mortality rates always start from 0
[0,0+age_group).
Examples
if (FALSE) { # \dontrun{
# Read opop file into global environment
opop <- read_opop(path = "my_path")
# Retrieve age-specific mortality rates
asmr <- get_asmr_socsim(opop = opop,
final_sim_year = 2021,
year_min = 1750,
year_max = 2020,
year_group = 5,
age_max_mort = 110,
age_group = 5)
} # }