The R Project SVN R

Rev

Rev 73668 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 73668 Rev 73692
Line 6... Line 6...
6
\name{coef}
6
\name{coef}
7
\title{Extract Model Coefficients}
7
\title{Extract Model Coefficients}
8
\alias{coef}
8
\alias{coef}
9
\alias{coefficients}
9
\alias{coefficients}
10
\alias{coef.default}% not exported
10
\alias{coef.default}% not exported
-
 
11
\alias{coef.aov}
11
\usage{
12
\usage{
12
coef(object, \dots)
13
coef(object, \dots)
13
coefficients(object, \dots)
14
coefficients(object, \dots)
14
\S3method{coef}{default}(object, complete = TRUE, \dots)
15
\S3method{coef}{default}(object, complete = TRUE, \dots)
-
 
16
\S3method{coef}{aov}(object, complete = FALSE, \dots)
15
}
17
}
16
\arguments{
18
\arguments{
17
  \item{object}{an object for which the extraction of model coefficients is
19
  \item{object}{an object for which the extraction of model coefficients is
18
    meaningful.}
20
    meaningful.}
19
  \item{complete}{for the default method (used for \code{lm}, etc):
21
  \item{complete}{for the default (used for \code{lm}, etc) and
-
 
22
    \code{aov} methods:
20
    logical indicating if the full coefficient vector should be returned
23
    logical indicating if the full coefficient vector should be returned
21
    also in case of an over-determined system where some coefficients will be set
24
    also in case of an over-determined system where some coefficients
22
    to \code{\link{NA}}, see also \code{\link{alias}}.  This argument
25
    will be set to \code{\link{NA}}, see also \code{\link{alias}}.  Note
23
    also exists for compatibility with \code{\link{vcov}} methods.}
26
    that the default \emph{differs} for \code{\link{lm}()} and
-
 
27
    \code{\link{aov}()} results.}
24
  \item{\dots}{other arguments.}
28
  \item{\dots}{other arguments.}
25
}
29
}
26
\description{
30
\description{
27
  \code{coef} is a generic function which extracts model coefficients
31
  \code{coef} is a generic function which extracts model coefficients
28
  from objects returned by modeling functions.  \code{coefficients} is
32
  from objects returned by modeling functions.  \code{coefficients} is
Line 31... Line 35...
31
\details{
35
\details{
32
  All object classes which are returned by model fitting functions
36
  All object classes which are returned by model fitting functions
33
  should provide a \code{coef} method or use the default one.
37
  should provide a \code{coef} method or use the default one.
34
  (Note that the method is for \code{coef} and not \code{coefficients}.)
38
  (Note that the method is for \code{coef} and not \code{coefficients}.)
35
 
39
 
-
 
40
  The \code{"aov"} method does not report aliased coefficients (see
-
 
41
  \code{\link{alias}}) by default where \code{complete = FALSE}.
-
 
42
 
-
 
43
  The \code{complete} argument also exists for compatibility with
36
  Class \code{"aov"} has a \code{coef} method that does not report
44
  \code{\link{vcov}} methods, and \code{coef} and \code{aov} methods for
37
  aliased coefficients (see \code{\link{alias}}).
45
  other classes should typically also keep the \code{complete = *}
-
 
46
  behavior in sync.  By that, with \code{p <- length(coef(obj, complete = TF))},
-
 
47
  \code{dim(vcov(obj, complete = TF)) == c(p,p)} will be fulfilled for both
-
 
48
  \code{complete} settings and the default.
38
}
49
}
39
\value{
50
\value{
40
  Coefficients extracted from the model object \code{object}.
51
  Coefficients extracted from the model object \code{object}.
41
 
52
 
42
  For standard model fitting classes this will be a named numeric vector.
53
  For standard model fitting classes this will be a named numeric vector.