EVOLUTION-MANAGER
Edit File: summary.lm.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Summarizing Linear Model Fits</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for summary.lm {stats}"><tr><td>summary.lm {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Summarizing Linear Model Fits</h2> <h3>Description</h3> <p><code>summary</code> method for class <code>"lm"</code>. </p> <h3>Usage</h3> <pre> ## 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"), ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>an object of class <code>"lm"</code>, usually, a result of a call to <code><a href="lm.html">lm</a></code>.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>an object of class <code>"summary.lm"</code>, usually, a result of a call to <code>summary.lm</code>.</p> </td></tr> <tr valign="top"><td><code>correlation</code></td> <td> <p>logical; if <code>TRUE</code>, the correlation matrix of the estimated parameters is returned and printed.</p> </td></tr> <tr valign="top"><td><code>digits</code></td> <td> <p>the number of significant digits to use when printing.</p> </td></tr> <tr valign="top"><td><code>symbolic.cor</code></td> <td> <p>logical. If <code>TRUE</code>, print the correlations in a symbolic form (see <code><a href="symnum.html">symnum</a></code>) rather than as numbers.</p> </td></tr> <tr valign="top"><td><code>signif.stars</code></td> <td> <p>logical. If <code>TRUE</code>, ‘significance stars’ are printed for each coefficient.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments passed to or from other methods.</p> </td></tr> </table> <h3>Details</h3> <p><code>print.summary.lm</code> tries to be smart about formatting the coefficients, standard errors, etc. and additionally gives ‘significance stars’ if <code>signif.stars</code> is <code>TRUE</code>. </p> <p>Aliased coefficients are omitted in the returned object but restored by the <code>print</code> method. </p> <p>Correlations are printed to two decimal places (or symbolically): to see the actual correlations print <code>summary(object)$correlation</code> directly. </p> <h3>Value</h3> <p>The function <code>summary.lm</code> computes and returns a list of summary statistics of the fitted linear model given in <code>object</code>, using the components (list elements) <code>"call"</code> and <code>"terms"</code> from its argument, plus </p> <table summary="R valueblock"> <tr valign="top"><td><code>residuals</code></td> <td> <p>the <em>weighted</em> residuals, the usual residuals rescaled by the square root of the weights specified in the call to <code>lm</code>.</p> </td></tr> <tr valign="top"><td><code>coefficients</code></td> <td> <p>a <i>p x 4</i> matrix with columns for the estimated coefficient, its standard error, t-statistic and corresponding (two-sided) p-value. Aliased coefficients are omitted.</p> </td></tr> <tr valign="top"><td><code>aliased</code></td> <td> <p>named logical vector showing if the original coefficients are aliased.</p> </td></tr> <tr valign="top"><td><code>sigma</code></td> <td> <p>the square root of the estimated variance of the random error </p> <p style="text-align: center;"><i>σ^2 = 1/(n-p) Sum(w[i] R[i]^2),</i></p> <p>where <i>R[i]</i> is the <i>i</i>-th residual, <code>residuals[i]</code>.</p> </td></tr> <tr valign="top"><td><code>df</code></td> <td> <p>degrees of freedom, a 3-vector <i>(p, n-p, p*)</i>, the first being the number of non-aliased coefficients, the last being the total number of coefficients.</p> </td></tr> <tr valign="top"><td><code>fstatistic</code></td> <td> <p>(for models including non-intercept terms) a 3-vector with the value of the F-statistic with its numerator and denominator degrees of freedom.</p> </td></tr> <tr valign="top"><td><code>r.squared</code></td> <td> <p><i>R^2</i>, the ‘fraction of variance explained by the model’, </p> <p style="text-align: center;"><i>R^2 = 1 - Sum(R[i]^2) / Sum((y[i]- y*)^2),</i></p> <p>where <i>y*</i> is the mean of <i>y[i]</i> if there is an intercept and zero otherwise.</p> </td></tr> <tr valign="top"><td><code>adj.r.squared</code></td> <td> <p>the above <i>R^2</i> statistic ‘<em>adjusted</em>’, penalizing for higher <i>p</i>.</p> </td></tr> <tr valign="top"><td><code>cov.unscaled</code></td> <td> <p>a <i>p x p</i> matrix of (unscaled) covariances of the <i>coef[j]</i>, <i>j=1, …, p</i>.</p> </td></tr> <tr valign="top"><td><code>correlation</code></td> <td> <p>the correlation matrix corresponding to the above <code>cov.unscaled</code>, if <code>correlation = TRUE</code> is specified.</p> </td></tr> <tr valign="top"><td><code>symbolic.cor</code></td> <td> <p>(only if <code>correlation</code> is true.) The value of the argument <code>symbolic.cor</code>.</p> </td></tr> <tr valign="top"><td><code>na.action</code></td> <td> <p>from <code>object</code>, if present there.</p> </td></tr> </table> <h3>See Also</h3> <p>The model fitting function <code><a href="lm.html">lm</a></code>, <code><a href="../../base/html/summary.html">summary</a></code>. </p> <p>Function <code><a href="coef.html">coef</a></code> will extract the matrix of coefficients with standard errors, t-statistics and p-values. </p> <h3>Examples</h3> <pre> ##-- 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 ## model with *aliased* coefficient: lm.D9. <- lm(weight ~ group + I(group != "Ctl")) Sm.D9. <- summary(lm.D9.) Sm.D9. # shows the NA NA NA NA line stopifnot(length(cc <- coef(lm.D9.)) == 3, is.na(cc[3]), dim(coef(Sm.D9.)) == c(2,4), Sm.D9.$df == c(2, 18, 3)) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>