model_constant | R Documentation |
Extracts the model constant term(s),
the model intercept, from a fitted model object.
model_constant(model, ...)
## S3 method for class 'gam'
model_constant(model, lp = NULL, ...)
## S3 method for class 'gamlss'
model_constant(model, ...)
model |
a fitted model for which a |
... |
arguments passed to other methods. |
lp |
numeric; which linear predictors to extract constant terms for. |
load_mgcv()
# simulate a small example
df <- data_sim("eg1", seed = 42)
# fit the GAM
m <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = df, method = "REML")
# extract the estimate of the constant term
model_constant(m)
# same as coef(m)[1L]
coef(m)[1L]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.