Routines for Descriptive and Model-Based APC Analysis
Internal helper to calculate the (group-specific) density of a variabl...
Internal function to capitalize the first letter of a character
Internal helper to compute marginal APC effects and their confidence i...
Internal helper to tilt the x-axis for the hexamap plot
Internal helper to tilt the x-axis for the hexamap plot
Create a summary table for multiple estimated GAM models
Internal helper to create a group variable as base for a density matri...
Internal helper to create a dataset for ggplot2 to highlight diagonals
Create model summary tables for multiple estimated GAM models
Internal helper to create a summary table for one estimated GAM model
Internal helper for gg_addReferenceLines to keep diagonal lines in the...
Internal helper to extract summary of linear effects in a gam model
Extract returned values of plot.gam() while suppressing creation of th...
Internal helper to add reference lines in an APC heatmap
Internal helper to add the diagonal highlighting to a ggplot
Plot 1D smooth effects for gam models
Heatmap of an APC surface
Hexamap of an APC surface
Internal helper to plot a categorical density
Internal helper to plot a metric density
Plot the density of one metric or categorical variable
Create a matrix of density plots
Joint plot to compare the marginal APC effects of multiple models
Plot linear effects of a gam in an effect plot
Plot of marginal APC effects based on an estimated GAM model
Partial APC plots based on an estimated GAM model
Distribution plot of one variable against one APC dimension
Age-Period-Cohort (APC) analyses are used to differentiate relevant drivers for long-term developments. The 'APCtools' package offers visualization techniques and general routines to simplify the workflow of an APC analysis. Sophisticated functions are available both for descriptive and regression model-based analyses. For the former, we use density (or ridgeline) matrices and (hexagonally binned) heatmaps as innovative visualization techniques building on the concept of Lexis diagrams. Model-based analyses build on the separation of the temporal dimensions based on generalized additive models, where a tensor product interaction surface (usually between age and period) is utilized to represent the third dimension (usually cohort) on its diagonal. Such tensor product surfaces can also be estimated while accounting for further covariates in the regression model. See Weigert et al. (2021) <doi:10.1177/1354816620987198> for methodological details.