Rev 15561 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{lm.summary}\alias{summary.lm}\alias{summary.lm.null}\alias{summary.mlm}% mlm is *not* mentioned at all\alias{print.summary.lm}\alias{print.summary.lm.null}\title{Summarizing Linear Model Fits}\usage{\method{summary}{lm}(object, correlation = FALSE, \dots)\method{print}{summary.lm}(x, digits = max(3, getOption("digits") - 3),symbolic.cor = p > 4,signif.stars = getOption("show.signif.stars"), \dots)}\arguments{\item{object}{an object of class \code{"lm"}, usually, a result of acall to \code{\link{lm}}.}\item{x}{an object of class \code{"summary.lm"}, usually, a result of acall to \code{summary.lm}.}\item{correlation}{logical; if \code{TRUE}, the correlation matrix ofthe estimated parameters is returned and printed.}\item{digits}{the number of significant digits to use when printing.}\item{symbolic.cor}{logical. If \code{TRUE}, print the correlations ina symbolic form (see \code{\link{symnum}} rather than as numbers.}\item{signif.stars}{logical. If \code{TRUE}, ``significance stars''are printed for each coefficient.}\item{\dots}{further arguments passed to or from other methods.}}\description{\code{summary} method for class \code{"lm"}.}\details{\code{print.summary.lm} tries to be smart about formatting thecoefficients, standard errors, etc. and additionally gives``significance stars'' if \code{signif.stars} is \code{TRUE}.}\value{The function \code{summary.lm} computes and returns a list of summarystatistics of the fitted linear model given in \code{object}, usingthe components (list elements) \code{"call"} and \code{"terms"}from its argument, plus\item{residuals}{the \emph{weighted} residuals, the usual residualsrescaled by the square root of the weights specified in the call to\code{lm}.}\item{coefficients}{a \eqn{p \times 4}{p x 4} matrix with columns forthe estimated coefficient, its standard error, t-statistic andcorresponding (two-sided) p-value.}\item{sigma}{the square root of the estimated variance of the randomerror\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, \code{residuals[i]}.}\item{df}{degrees of freedom, a 3-vector \eqn{(p, n-p, p*)}.}\item{fstatistic}{a 3-vector with the value of the F-statistic withits numerator and denominator degrees of freedom.}\item{r.squared}{\eqn{R^2}, the ``fraction of variance explained bythe 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 anintercept and zero otherwise.}\item{adj.r.squared}{the above \eqn{R^2} statistic\emph{``adjusted''}, penalizing for higher \eqn{p}.}\item{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{correlation}{the correlation matrix corresponding to the above\code{cov.unscaled}, if \code{correlation = TRUE} is specified.}}\seealso{The model fitting function \code{\link{lm}}, \code{\link{summary}}.}\examples{\testonly{example("lm", echo = FALSE)}##-- Continuing the lm(.) example:coef(lm.D90)# the bare coefficientssld90 <- summary(lm.D90 <- lm(weight ~ group -1))# omitting interceptsld90coef(sld90)# much more}\keyword{regression}\keyword{models}