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, ...)
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. |
A data.frame
with the coefficients, standard error, and upper
and lower bounds.
This essentially reproduces the 'parametric' output from
summary.gam
.
library(mgcv)#>#>#>#> #>#>#> #>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.46729extract_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