EVOLUTION-MANAGER
Edit File: nobs.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 the Number of Observations from a Fit.</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 nobs {stats}"><tr><td>nobs {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Extract the Number of Observations from a Fit. </h2> <h3>Description</h3> <p>Extract the number of ‘observations’ from a model fit. This is principally intended to be used in computing BIC (see <code><a href="AIC.html">AIC</a></code>). </p> <h3>Usage</h3> <pre> nobs(object, ...) ## Default S3 method: nobs(object, use.fallback = FALSE, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>A fitted model object.</p> </td></tr> <tr valign="top"><td><code>use.fallback</code></td> <td> <p>logical: should fallback methods be used to try to guess the value?</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Further arguments to be passed to methods.</p> </td></tr> </table> <h3>Details</h3> <p>This is a generic function, with an S4 generic in package <span class="pkg">stats4</span>. There are methods in this package for objects of classes <code>"<a href="lm.html">lm</a>"</code>, <code>"<a href="glm.html">glm</a>"</code>, <code>"<a href="nls.html">nls</a>"</code> and <code>"<a href="logLik.html">logLik</a>"</code>, as well as a default method (which throws an error, unless <code>use.fallback = TRUE</code> when it looks for <code>weights</code> and <code>residuals</code> components – use with care!). </p> <p>The main usage is in determining the appropriate penalty for BIC, but <code>nobs</code> is also used by the stepwise fitting methods <code><a href="step.html">step</a></code>, <code><a href="add1.html">add1</a></code> and <code><a href="add1.html">drop1</a></code> as a quick check that different fits have been fitted to the same set of data (and not, say, that further rows have been dropped because of NAs in the new predictors). </p> <p>For <code>lm</code>, <code>glm</code> and <code>nls</code> fits, observations with zero weight are not included. </p> <h3>Value</h3> <p>A single number, normally an integer. Could be <code>NA</code>. </p> <h3>See Also</h3> <p><code><a href="AIC.html">AIC</a></code>. </p> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>