ageperiod_group {APCI} | R Documentation |
This function returns the cohort index matrix for any age and period groups. The cohort index matrix will then be used to extract the cohort effects.
ageperiod_group(age_range, period_range,
age_interval, period_interval,
age_group = NULL, period_group = NULL)
age_range, period_range |
Numeric vector indicating the actual age and period range (e.g., 10 to 59 years old from 2000 to 2019). |
age_interval, period_interval, age_group, period_group |
Numeric values or character vectors indicating how age and period are
grouped. |
It returns a matrix respresenting the relationship among age, period, and cohort groups under the current setting.
## age and period groups have equal width
ageperiod_group(age_range = 10:59, period_range = 2000:2019,
age_interval = 5, period_interval = 5)
ageperiod_group(age_range = 10:59, period_range = 2000:2019,
age_group = c("10-14","15-19","20-24","25-29",
"30-34","35-39","40-44","45-49",
"50-54","55-59"),
period_group = c("2000-2004","2005-2009","2010-2014","2015-2019"))
## age and period groups have unequal width
ageperiod_group(age_range = 10:59, period_range = 2000:2019,
age_interval = 10, period_interval = 5)
ageperiod_group(age_range = 10:59, period_range = 2000:2019,
age_group = c("10-19","20-29","30-39","40-49","50-59"),
period_group = c("2000-2004","2005-2009","2010-2014","2015-2019"))