
Extract fixed effects estimates from a fitted model
Source:R/effects.R, R/scam-methods.R
fixed_effects.gam.RdExtract fixed effects estimates from a fitted model
Usage
fixed_effects(object, ...)
# S3 method for class 'gam'
fixed_effects(object, ...)
# S3 method for class 'gamm'
fixed_effects(object, ...)
# S3 method for class 'gamm4'
fixed_effects(object, ...)
# S3 method for class 'lm'
fixed_effects(object, ...)
# S3 method for class 'glm'
fixed_effects(object, ...)
# Default S3 method
fixed_effects(object, ...)
# S3 method for class 'scam'
fixed_effects(object, ...)Arguments
- object
a fitted model. Supported classes are models fitted by
mgcv::gam(),mgcv::bam(),mgcv::gamm(),gamm4::gamm4(),scam::scam(),stats::glm(), andstats::lm().- ...
arguments passed to other methods
Details
Starting with gratia 0.12.1, use fixed_effects() for the models listed
above if you previously called gratia::fixef() or a fixef() method
supplied by gratia. For models fitted directly with nlme or lme4, use
nlme::fixef() or lme4::fixef(), respectively.
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"
)
fixed_effects(m)
}
#> Loading required package: lme4
#> Loading required package: Matrix
#> (Intercept) Days
#> 251.40510 10.46729