create_APCsummary {APCtools} | R Documentation |
Create a summary table for multiple estimated GAM models
Description
Create a table to summarize the overall effect strengths of the age, period
and cohort effects for models fitted with gam
or
bam
. The output format can be adjusted by passing
arguments to kable
via the ...
argument.
Usage
create_APCsummary(model_list, dat, digits = 2, apc_range = NULL, ...)
Arguments
model_list |
A list of regression models estimated with
|
dat |
Dataset with columns |
digits |
Number of digits for numeric columns. Defaults to 2. |
apc_range |
Optional list with one or multiple elements with names
|
... |
Optional additional arguments passed to |
Details
If the model was estimated with a log or logit link, the function automatically performs an exponential transformation of the effect.
Value
Table created with kable
.
Author(s)
Alexander Bauer alexander.bauer@stat.uni-muenchen.de
Examples
library(APCtools)
library(mgcv)
data(travel)
# create the summary table for one model
model_pure <- gam(mainTrip_distance ~ te(age, period), data = travel)
create_APCsummary(model_pure, dat = travel)
# create the summary table for multiple models
model_cov <- gam(mainTrip_distance ~ te(age, period) + s(household_income),
data = travel)
model_list <- list("pure model" = model_pure,
"covariate model" = model_cov)
create_APCsummary(model_list, dat = travel)