Extract Model Coefficients

Share:

Description

coef is a generic function which extracts model coefficients from objects returned by modeling functions. coefficients is an alias for it.

Usage

1
2
coef(object, ...)
coefficients(object, ...)

Arguments

object

an object for which the extraction of model coefficients is meaningful.

...

other arguments.

Details

All object classes which are returned by model fitting functions should provide a 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).

Value

Coefficients extracted from the model object object.

For standard model fitting classes this will be a named numeric vector. For "maov" objects (produced by aov) it will be a matrix.

References

Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S. Wadsworth & Brooks/Cole.

See Also

fitted.values and residuals for related methods; glm, lm for model fitting.

Examples

1
x <- 1:5; coef(lm(c(1:3, 7, 6) ~ x))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.