MAPCtools0.1.0 package

Multivariate Age-Period-Cohort (MAPC) Modeling for Health Data

abinomial

Aggregate binomial data

add_APC_by_match

Add 1-indexed age, period and cohort indices via match()

add_cohort_column

Add cohort column to data frame

add_cohort_index

Add cohort column to data frame

agaussian

Aggregate Gaussian data

aggregate_df

Aggregate data across an entire data frame using sufficient statistics

aggregate_grouped_df

Aggregate grouped data using aggregate_df

amultinomial

Aggregate multinomial data. Used in aggregate_df.

as.APC.df

Add 1-indexed APC columns to data frame, handling numeric or categoric...

as.APC.NA.df

Create NA structure across age, period and cohort groups based on stra...

binomial_aggregator

Aggregate binomial data

check_cols_exist

Check if a set of columns is missing from a data frame. For use in `ag...

clamp

Clamp a numeric value within bounds

dynamic_pretty_breaks

Compute dynamic pretty breaks for continuous x-axis

dynamic_pretty_discrete_breaks

Compute dynamic pretty breaks for discrete x-axis

expected_groups

Find expected groups based on distinct values across a set of variable...

fit_all_MAPC

Fit all configurations of MAPC models using INLA

fit_MAPC

Fit a multivariable age-period-cohort model

gaussian_aggregator

Aggregate Gaussian data

generate_apc_lincombs

Generate Age-Period-Cohort Linear Combinations for INLA

generate_MAPC_formula

Generate MAPC formula for INLA

longest_run

Function for finding longest consecutive run of non-missing indices

model_selection_criteria_table

Make a table of model fit scores

multinomial_aggregator

Aggregate multinomial data (No changes needed here)

number_of_groups

Count number of groups across a set of variables in a data frame

number_of_strata

Count number of groups across a set of variables in a data frame

plot_binned_counts

Plot counts of observations across bins of a numeric variable, optiona...

plot_counts_1D

Plot counts of observations across a single variable, optionally strat...

plot_counts_2D

Plot counts of observations across two dimensions, optionally stratifi...

plot_counts_with_mean

Plot heatmap of observation counts with mean overlay, optionally strat...

plot_lincombs

Plot Linear Combinations of Age-Period-Cohort Effects by Strata

plot_mean_response_1D

Plot mean of a response variable across a single variable, optionally ...

plot_mean_response_2D

Plot mean of a response variable across two dimensions, optionally str...

plot_missing_data

Plot Missing Group Combinations

plot_model_selection_criteria

Make a plot of model fit scores

plot_time_effect

Plot time effects with uncertainty ribbons

resolve_column

Helper for evaluating column names, strings, or self-contained vectors

validate_lincombs_against_formula

Validate lincomb terms against an INLA formula

Bayesian multivariate age-period-cohort (MAPC) models for analyzing health data, with support for model fitting, visualization, stratification, and model comparison. Inference focuses on identifiable cross-strata differences, as described by Riebler and Held (2010) <doi:10.1093/biostatistics/kxp037>. Methods for handling complex survey data via the 'survey' package are included, as described in Mercer et al. (2014) <doi:10.1016/j.spasta.2013.12.001>.

  • Maintainer: Lars Vatten
  • License: MIT + file LICENSE
  • Last published: 2025-06-25