Learn R Programming

apc (version 3.0.0)

apc.plot.fit.2s: Plots of apc estimates for 2 sample model

Description

Generalizes apc.plot.fit to a 2 sample model. For an application, see the vignette ReproducingN2025.pdf, ReproducingN2025.R on vignette.

Usage

apc.plot.fit.2s(apc.fit.model.1,apc.fit.model.2,
            type="macro",which.plot=0,
            col=NULL,label=NULL,lty=NULL)

Arguments

apc.fit.model.1

List. See apc.fit.model for a description of the format.

apc.fit.model.2

List. See apc.fit.model for a description of the format.

type

Optional. Default is "macro".

"macro"

If which.plot is omitted or set to 0 six plots will be made. Single plot of one of the fits can achieved by giving which.plot one of the following values. 1: both micro age fits; 2: both micro period fits; 3: both micro cohort fits; 4: difference of micro age fits; 5: difference of micro period fits; 6: difference of micro cohort fits.

"macro-detrend"

Same as macro.

"micro"

The micro effects only exist when the data have mixed frequency as coded in data.format. Thus, there are age and period in groups of length G and H respectively, this plots demeaned micro fits as well as the cross-sample difference. Some micro effects do not exist if G=1 or H=1. Single plot of one of the fits can achieved by giving which.plot one of the following values. 1: both micro age fits if G>1; 2: both micro period fits if H>1; 3: both micro cohort fits if G*H>1; 4: difference of micro age fits if G>1; 5: difference of micro period fits if H>1; 6: difference of micro cohort fits if G*H>1. If data.format is regular nothing is plotted as there are no micro fits.

which.plot

Optional. If 0, then more than one plot may be made. For the numbering of plots, see type. Default is 0.

col

NULL

label

NULL

lty

NULL

Author

Bent Nielsen <bent.nielsen@nuffield.ox.ac.uk> 3 Jul 2025

References

Nielsen, B. (2022) Two-sample age-period-cohort models with an application to Swiss suicide rates. Download: Nuffield Discussion Paper 2022-W03.