\Header{lm.summaries}{Accessing Linear Model Fits}
\alias{anova.lm}{lm.summaries}
\alias{anova.lm.null}{lm.summaries}
\alias{anova.mlm}{lm.summaries}
\alias{anovalist.lm}{lm.summaries}
\alias{summary.lm}{lm.summaries}
\alias{summary.lm.null}{lm.summaries}
\alias{summary.mlm}{lm.summaries}
\alias{coefficients.lm}{lm.summaries}
\alias{df.residual.lm}{lm.summaries}
\alias{family.lm}{lm.summaries}
\alias{formula.lm}{lm.summaries}
\alias{fitted.values.lm}{lm.summaries}
\alias{residuals.lm}{lm.summaries}
\alias{weights}{lm.summaries}
\alias{weights.lm}{lm.summaries}
\alias{plot.lm}{lm.summaries}
\alias{plot.mlm}{lm.summaries}
\alias{print.lm}{lm.summaries}
\alias{print.lm.null}{lm.summaries}
\alias{print.summary.lm}{lm.summaries}
\alias{print.summary.lm.null}{lm.summaries}
\keyword{regression}{lm.summaries}
\begin{Usage}
\begin{verbatim}
anova(object, ...)
anovalist(object, ..., test = NULL)
summary(object, correlation = FALSE)
coefficients(x) ; coef(x)
df.residual(x)
family(x)
formula(x)
fitted.values(x)
residuals(x)
weights(x)
plot(x)

print(summary.lm.obj, digits = max(3, .Options$digits - 3),
      symbolic.cor = p > 4,
      signif.stars= .Options$show.signif.stars, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{object,x}] an object of class \texttt{lm}, usually, a result of
\texttt{\Link{lm}(..)}.
\end{ldescription}
\end{Arguments}
\begin{Description}
All these functions are \texttt{\Link{methods}} for class \texttt{lm} or
\texttt{summary.lm} and \texttt{anova.lm} objects.\end{Description}
\begin{Details}
\texttt{print.summary.lm} tries to be smart about formatting the
coefficients, standard errors, etc. and additionally gives
``significance stars'' if \texttt{signif.stars} is \texttt{TRUE}.

\texttt{anova.lm} produces an analysis of variance (\texttt{anova}) table.

The generic accessor functions \texttt{coefficients}, \texttt{effects},
\texttt{fitted.values} and \texttt{residuals} can be used to extract
various useful features of the value returned by \texttt{lm}.\end{Details}
\begin{Value}
The function \texttt{summary.lm} computes and returns a list of summary
statistics of the fitted linear model given in \texttt{lm.obj}, using
the slots (list elements) \texttt{"call"}, \texttt{"terms"}, and
\texttt{"residuals"} from its argument, plus
\begin{ldescription}
\item[\texttt{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.
\item[\texttt{sigma}] the square root of the estimated variance of the random
error
\deqn{\hat\sigma^2 = \frac{1}{n-p}\sum_i{R_i^2},}{sigma^2 = 1/(n-p) Sum(R[i]^2),}
where \eqn{R_i}{R[i]} is the \eqn{i}{}-th residual,
\texttt{residuals[i]}.
\item[\texttt{df}] degrees of freedom, a 3-vector \eqn{(p,n-p,p*)}{} ...
\item[\texttt{fstatistic}] a 3-vector with the value of the F-statistic with
its numerator and denominator degrees of freedom.
\item[\texttt{r.squared}] \eqn{R^2}{}, the ``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[\texttt{adj.r.squared}] the above \eqn{R^2}{} statistic
\emph{``adjusted''}, penalizing for higher \eqn{p}{}.
\item[\texttt{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[\texttt{correlation}] the correlation matrix corresponding to the above
\texttt{cov.unscaled}, if \texttt{correlation = TRUE} is specified.
\end{ldescription}
\end{Value}
\begin{SeeAlso}
The model fitting function \texttt{\Link{lm}}.

\texttt{\Link{anova}} for the ANOVA table,
\texttt{\Link{coefficients}}, \texttt{\Link{deviance}},
\texttt{\Link{effects}}, \texttt{\Link{fitted.values}},
\texttt{\Link{glm}} for \bold{generalized} linear models,
\texttt{\Link{lm.influence}} for regression diagnostics,
\texttt{\Link{residuals}}, \texttt{\Link{summary}}.\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

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

qqnorm(residuals(lm.D90))

##-- 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

## The 2 basic regression diagnostic plots:
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}

