\Header{lm.summaries}{Accessing Linear Model Fits}
\alias{family.lm}{lm.summaries}
\alias{formula.lm}{lm.summaries}
\alias{residuals.lm}{lm.summaries}
\alias{weights}{lm.summaries}
\methalias{weights.default}{lm.summaries}
\keyword{regression}{lm.summaries}
\keyword{models}{lm.summaries}
\begin{Description}\relax
All these functions are \code{\Link{methods}} for class \code{"lm"}  objects.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'lm':
family(object, ...)

## S3 method for class 'lm':
formula(x, ...)

## S3 method for class 'lm':
residuals(object,
          type = c("working", "response", "deviance","pearson", "partial"),
          ...)

weights(object, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object, x}] an object inheriting from class \code{lm}, usually
the result of a call to \code{\Link{lm}} or \code{\Link{aov}}.
\item[\code{...}] further arguments passed to or from other methods.
\item[\code{type}] the type of residuals which should be returned.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The generic accessor functions \code{coef}, \code{effects},
\code{fitted} and \code{residuals} can be used to extract
various useful features of the value returned by \code{lm}.

The working and response residuals are \dQuote{observed - fitted}.  The
deviance and pearson residuals are weighted residuals, scaled by the
square root of the weights used in fitting.  The partial residuals
are a matrix with each column formed by omitting a term from the
model.  In all these, zero weight cases are never omitted (as opposed
to the standardized \code{\Link{rstudent}} residuals).
\end{Details}
\begin{References}\relax
Chambers, J. M. (1992)
\emph{Linear models.}
Chapter 4 of \emph{Statistical Models in S}
eds J. M. Chambers and T. J. Hastie, Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
The model fitting function \code{\Link{lm}}, \code{\Link{anova.lm}}.

\code{\Link{coef}}, \code{\Link{deviance}},
\code{\Link{df.residual}},
\code{\Link{effects}}, \code{\Link{fitted}},
\code{\Link{glm}} for \bold{generalized} linear models,
\code{\Link{influence}} (etc on that page) for regression diagnostics,
\code{\Link{weighted.residuals}},
\code{\Link{residuals}}, \code{\Link{residuals.glm}},
\code{\Link{summary.lm}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

##-- Continuing the  lm(.) example:
coef(lm.D90)# the bare coefficients

## The 2 basic regression diagnostic plots [plot.lm(.) is preferred]
plot(resid(lm.D90), fitted(lm.D90))# Tukey-Anscombe's
abline(h=0, lty=2, col = 'gray')

qqnorm(residuals(lm.D90))
\end{ExampleCode}
\end{Examples}

