powered by
Returns number of observations for statistical models. The default method assumes presence of a component param$nObs in x.
param$nObs
x
nObs(x, ...) # S3 method for default nObs(x, ...) # S3 method for lm nObs(x, ...)
numeric, number of observations
a statistical model, such as created by lm
lm
further arguments for methods
Ott Toomet, otoomet@econ.au.dk
This is a generic function. The default method returns the component x$param$nObs. The lm-method is based on qr-decomposition, in the same way as the does summary.lm.
x$param$nObs
summary.lm
# Construct a simple OLS regression: x1 <- runif(100) x2 <- runif(100) y <- 3 + 4*x1 + 5*x2 + rnorm(100) m <- lm(y~x1+x2) # estimate it nObs(m)
Run the code above in your browser using DataLab