coef is a generic function which extracts model coefficients
from objects returned by modeling functions. coefficients is
an alias for it.
Usage
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
x <- 1:5; coef(lm(c(1:3, 7, 6) ~ x))
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(stats)
> png(filename="/home/ddbj/snapshot/RGM3/R_rel/result/stats/coef.Rd_%03d_medium.png", width=480, height=480)
> ### Name: coef
> ### Title: Extract Model Coefficients
> ### Aliases: coef coefficients
> ### Keywords: regression models
>
> ### ** Examples
>
> x <- 1:5; coef(lm(c(1:3, 7, 6) ~ x))
(Intercept) x
-0.7 1.5
>
>
>
>
>
> dev.off()
null device
1
>