\HeaderA{summary.lm}{Summarizing Linear Model Fits}{summary.lm}
\aliasA{print.summary.lm}{summary.lm}{print.summary.lm}
\aliasA{summary.mlm}{summary.lm}{summary.mlm}
\keyword{regression}{summary.lm}
\keyword{models}{summary.lm}
\begin{Description}\relax
\code{summary} method for class \code{"lm"}.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'lm':
summary(object, correlation = FALSE, symbolic.cor = FALSE, ...)

## S3 method for class 'summary.lm':
print(x, digits = max(3, getOption("digits") - 3),
      symbolic.cor = x$symbolic.cor,
      signif.stars = getOption("show.signif.stars"), ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object of class \code{"lm"}, usually, a result of a
call to \code{\LinkA{lm}{lm}}.
\item[\code{x}] an object of class \code{"summary.lm"}, usually, a result of a
call to \code{summary.lm}.
\item[\code{correlation}] logical; if \code{TRUE}, the correlation matrix of
the estimated parameters is returned and printed.
\item[\code{digits}] the number of significant digits to use when printing.
\item[\code{symbolic.cor}] logical. If \code{TRUE}, print the correlations in
a symbolic form (see \code{\LinkA{symnum}{symnum}}) rather than as numbers.
\item[\code{signif.stars}] logical. If \code{TRUE}, \dQuote{significance stars}
are printed for each coefficient.
\item[\code{...}] further arguments passed to or from other methods.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{print.summary.lm} tries to be smart about formatting the
coefficients, standard errors, etc. and additionally gives
\dQuote{significance stars} if \code{signif.stars} is \code{TRUE}.

Correlations are printed to two decimal places (or symbolically): to
see the actual correlations print \code{summary(object)\$correlation}
directly.
\end{Details}
\begin{Value}
The function \code{summary.lm} computes and returns a list of summary
statistics of the fitted linear model given in \code{object}, using
the components (list elements) \code{"call"} and \code{"terms"}
from its argument, plus
\begin{ldescription}
\item[\code{residuals}] the \emph{weighted} residuals, the usual residuals
rescaled by the square root of the weights specified in the call to
\code{lm}.
\item[\code{coefficients}] a \eqn{p \times 4}{p x 4} matrix with columns for
the estimated coefficient, its standard error, t-statistic and
corresponding (two-sided) p-value.  Aliased coefficients are omitted.
\item[\code{aliased}] named logical vector showing if the original
coefficients are aliased.
\item[\code{sigma}] the square root of the estimated variance of the random
error
\deqn{\hat\sigma^2 = \frac{1}{n-p}\sum_i{w_i R_i^2},}{sigma^2 = 1/(n-p) Sum(w[i] R[i]^2),}
where \eqn{R_i}{R[i]} is the \eqn{i}{}-th residual, \code{residuals[i]}.
\item[\code{df}] degrees of freedom, a 3-vector \eqn{(p, n-p, p*)}{}, the last
being the number of non-aliased coefficients.
\item[\code{fstatistic}] (for models including non-intercept terms)
a 3-vector with the value of the F-statistic with
its numerator and denominator degrees of freedom.
\item[\code{r.squared}] \eqn{R^2}{}, the \dQuote{fraction of variance explained by
the model},
\deqn{R^2 = 1 - \frac{\sum_i{R_i^2}}{\sum_i(y_i- y^*)^2},}{R^2 = 1 - Sum(R[i]^2) / Sum((y[i]- y*)^2),}
where \eqn{y^*}{y*} is the mean of \eqn{y_i}{y[i]} if there is an
intercept and zero otherwise.
\item[\code{adj.r.squared}] the above \eqn{R^2}{} statistic
\dQuote{\emph{adjusted}}, penalizing for higher \eqn{p}{}.
\item[\code{cov.unscaled}] a \eqn{p \times p}{p x p} matrix of (unscaled)
covariances of the \eqn{\hat\beta_j}{coef[j]}, \eqn{j=1, \dots, p}{}.
\item[\code{correlation}] the correlation matrix corresponding to the above
\code{cov.unscaled}, if \code{correlation = TRUE} is specified.
\item[\code{symbolic.cor}] (only if \code{correlation} is true.)  The value
of the argument \code{symbolic.cor}.
\item[\code{na.action}] from \code{object}, if present there.
\end{ldescription}
\end{Value}
\begin{SeeAlso}\relax
The model fitting function \code{\LinkA{lm}{lm}}, \code{\LinkA{summary}{summary}}.

Function \code{\LinkA{coef}{coef}} will extract the matrix of coefficients
with standard errors, t-statistics and p-values.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

##-- Continuing the  lm(.) example:
coef(lm.D90)# the bare coefficients
sld90 <- summary(lm.D90 <- lm(weight ~ group -1))# omitting intercept
sld90
coef(sld90)# much more
\end{ExampleCode}
\end{Examples}

