coef
is a generic function which extracts model coefficients
from objects returned by modeling functions. coefficients
is
an alias for it.
coef(object, ...)
coefficients(object, ...)
object
.For standard model fitting classes this will be a named numeric vector.
coef
method or use the default one.
(Note that the method is for coef
and not coefficients
.) Class "aov"
has a coef
method that does not report
aliased coefficients (see alias
).
fitted.values
and residuals
for related methods;
glm
, lm
for model fitting.
x <- 1:5; coef(lm(c(1:3, 7, 6) ~ x))
Run the code above in your browser using DataLab