When using a GAM for mixed models, we may have specific interest in the fixed effect parameters.

extract_fixed(model, ci_level = 0.95, digits = 3, ...)

Arguments

model

A gam or bam model

ci_level

Level for the confidence interval. Must be between 0 and 1.

digits

Rounding for the output.

...

Passed to summary.gam, e.g. to set re.test = FALSE.

Value

A data.frame with the coefficients, standard error, and upper and lower bounds.

Details

This essentially reproduces the 'parametric' output from summary.gam.

See also

Examples

library(mgcv)
#> Loading required package: nlme
#> This is mgcv 1.8-33. For overview type 'help("mgcv-package")'.
#> Loading required package: Matrix
#> #> Attaching package: ‘lme4’
#> The following object is masked from ‘package:nlme’: #> #> lmList
lmer_model <- lmer(Reaction ~ Days + (Days || Subject), data = sleepstudy) ga_model <- gam(Reaction ~ Days + s(Subject, bs = "re") + s(Days, Subject, bs = "re"), data = sleepstudy, method = "REML" ) fixef(lmer_model)
#> (Intercept) Days #> 251.40510 10.46729
extract_fixed(ga_model)
#> # A tibble: 2 x 7 #> term value se t p lower_2.5 upper_97.5 #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 Intercept 251. 6.88 36.5 0 238. 265. #> 2 Days 10.5 1.56 6.71 0 7.39 13.5