EVOLUTION-MANAGER
Edit File: coef.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: Extract Model Coefficients</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 coef {stats}"><tr><td>coef {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Extract Model Coefficients</h2> <h3>Description</h3> <p><code>coef</code> is a generic function which extracts model coefficients from objects returned by modeling functions. <code>coefficients</code> is an <em>alias</em> for it. </p> <h3>Usage</h3> <pre> coef(object, ...) coefficients(object, ...) ## Default S3 method: coef(object, complete = TRUE, ...) ## S3 method for class 'aov' coef(object, complete = FALSE, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>an object for which the extraction of model coefficients is meaningful.</p> </td></tr> <tr valign="top"><td><code>complete</code></td> <td> <p>for the default (used for <code>lm</code>, etc) and <code>aov</code> methods: logical indicating if the full coefficient vector should be returned also in case of an over-determined system where some coefficients will be set to <code><a href="../../base/html/NA.html">NA</a></code>, see also <code><a href="alias.html">alias</a></code>. Note that the default <em>differs</em> for <code><a href="lm.html">lm</a>()</code> and <code><a href="aov.html">aov</a>()</code> results.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>other arguments.</p> </td></tr> </table> <h3>Details</h3> <p>All object classes which are returned by model fitting functions should provide a <code>coef</code> method or use the default one. (Note that the method is for <code>coef</code> and not <code>coefficients</code>.) </p> <p>The <code>"aov"</code> method does not report aliased coefficients (see <code><a href="alias.html">alias</a></code>) by default where <code>complete = FALSE</code>. </p> <p>The <code>complete</code> argument also exists for compatibility with <code><a href="vcov.html">vcov</a></code> methods, and <code>coef</code> and <code>aov</code> methods for other classes should typically also keep the <code>complete = *</code> behavior in sync. By that, with <code>p <- length(coef(obj, complete = TF))</code>, <code>dim(vcov(obj, complete = TF)) == c(p,p)</code> will be fulfilled for both <code>complete</code> settings and the default. </p> <h3>Value</h3> <p>Coefficients extracted from the model object <code>object</code>. </p> <p>For standard model fitting classes this will be a named numeric vector. For <code>"maov"</code> objects (produced by <code><a href="aov.html">aov</a></code>) it will be a matrix. </p> <h3>References</h3> <p>Chambers, J. M. and Hastie, T. J. (1992) <em>Statistical Models in S</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="fitted.values.html">fitted.values</a></code> and <code><a href="residuals.html">residuals</a></code> for related methods; <code><a href="glm.html">glm</a></code>, <code><a href="lm.html">lm</a></code> for model fitting. </p> <h3>Examples</h3> <pre> x <- 1:5; coef(lm(c(1:3, 7, 6) ~ x)) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>