Extract fixed effects estimates from a fitted GAM
Examples
load_mgcv()
# run example if lme4 is available
if (require("lme4")) {
data(sleepstudy, package = "lme4")
m <- gam(
Reaction ~ Days + s(Subject, bs = "re") +
s(Days, Subject, bs = "re"),
data = sleepstudy, method = "REML"
)
fixef(m)
}
#> Loading required package: lme4
#> Loading required package: Matrix
#> (Intercept) Days
#> 251.40510 10.46729