Learn R Programming

apc (version 3.0.0)

Age-Period-Cohort Analysis

Description

Functions for age-period-cohort analysis. Aggregate data can be organised in matrices indexed by age-cohort, age-period or cohort-period. The data can include dose and response or just doses. The statistical model is a generalized linear model (GLM) allowing for 3,2,1 or 0 of the age-period-cohort factors. 2-sample analysis is possible. Mixed frequency data are possible. Individual-level data should have a row for each individual and columns for each of age, period, and cohort. The statistical model for repeated cross-section is a generalized linear model. The statistical model for panel data is ordinary least squares. The canonical parametrisation of Kuang, Nielsen and Nielsen (2008) is used. Thus, the analysis does not rely on ad hoc identification.

Copy Link

Version

Install

install.packages('apc')

Monthly Downloads

593

Version

3.0.0

License

GPL-3

Maintainer

Bent Nielsen

Last Published

July 7th, 2025

Functions in apc (3.0.0)

apc.identify.mixed

Identification of time effects for mixed frequency data
apc.indiv.model.table

Generate table to select APC submodel
apc.plot.data.all

Make all descriptive plots.
apc.get.index

Get indices for mapping data into trapezoid formation
apc.plot.data.level

Level plot of data matrix.
apc.plot.data.sparsity

This plot shows heat map of the sparsity of a data matrix.
apc.hypothesis

Imposing hypotheses on age-period-cohort models.
apc.indiv.compare.direct

Implements direct tests between APC models
apc.indiv.est.model

Estimate a single APC model
apc.identify

Identification of time effects
apc.plot.fit.2s

Plots of apc estimates for 2 sample model
apc.plot.data.sums

This plot shows sums of data matrix by age, period or cohort.
apc.plot.fit.residuals

Level plots of residuals / fitted values / linear predictors
apc.plot.fit

Plots of apc estimates
apc.plot.fit.pt

Plot probability transform of responses given fitted values
apc-package

Age-period-cohort analysis
apc.plot.data.within

This plot shows time series of matrix within age, period or cohort.
apc.polygon

Add connected line and standard deviation polygons to a plot
apc.plot.fit.all

Make all fit plots.
apc.test.normal.residuals

Test normality of residuals
data.asbestos

Asbestos data
data.aids

UK aids data
data.Japanese.breast.cancer

Japanese breast cancer data
data.Belgian.lung.cancer

Belgian lung cancer data
data.RH.mortality

2-sample mortality data.
data.Italian.bladder.cancer

Italian bladder cancer data
data.loss.TA

Motor data
data.Swiss.suicides

Swiss suicide data
data.US.prostate.cancer

US prostate cancer data
apc-internal

Internal apc Functions
data.loss.VNJ

Motor data
data.loss.BZ

Motor data
triangle

Triangular matrices used in reserving
data.loss.XL

US Casualty data, XL Group
apc.forecast.apc

Forecast models with APC structure.
apc.get.design

Create design matrices
apc.fit.model.2s

Fits an age period cohort model for 2 samples
apc.forecast.ac

Forecast for responses model with AC or CL structure.
apc.forecast.ap

Forecast for Poisson response model with AP structure.
apc.data.list

Arrange data as an apc.data.list
apc.data.sums

Computes age, period and cohort sums of a matrix
apc.data.list.subset

Cut age, period and cohort groups from data set.
apc.forecast

Forecasts from age-period-cohort models.
apc.fit.model

Fits an age period cohort model