R/ols-model-info.R
ols_get_intercept.Rd
Returns the value of the model intercept.
ols_get_intercept(model)
An object of class lm.
lm
The value of the intercept.
model <- lm(mpg ~ wt + cyl + hp + disp + gear + drat, data = mtcars) ols_get_intercept(model) #> [1] 34.72139 model <- lm(mpg ~ 0 + wt + cyl + hp + disp, data = mtcars) ols_get_intercept(model) #> NULL