apcheader {APCG1}R Documentation

Add Header to APC Data Matrix.

Description

Add group labels to each row and column of APC data matrix, so that in data plot and the output of model parameter estimates, labels will be automatically calculated and used.

Usage

apcheader(r, header = F, agestart = 1, yearstart = 1, agespan = 1, yearspan = 1)

Arguments

r

matrix of APC data with a rows and p columns,

header

logic value. "False" prompts to add header to the data; "True" makes no change.

agestart, yearstart

starting value of age and period groups.

agespan, yearspan

spans or number of years in each group of age and period.

Details

Add a header to apc data matrix and label of the effects in the plot or model fitting output. without header, the group labels are group number: 1, 2, 3, ... for the age, period, and cohort effects.

Value

A matrix of the input APC data matrix with group labels in dimension names.

Note

A matrix with rows as age groups and columns as periods is preferred.

Author(s)

Wenjiang Fu

References

Fu, W. (2018) A Practical Guide to Age-Period-Cohort Analysis - the Identification Problem and Beyond, CRC.

See Also

apcplot, apclinfit, apcglmfit

Examples

r = matrix(c(1:40), ncol=8, byr=TRUE) 
r = apcheader(r, agestart=20, yearstart=1980, agespan=10, yearspan=5)

[Package APCG1 version 1.0 Index]