nObs {micEcon} | R Documentation |
Returns number of observations for statistical models. The default
method assumes presence of a component $param$nObs
in {x}.
nObs(x, ...) ## Default S3 method: nObs(x, ...) ## S3 method for class 'lm': nObs(x, ...)
x |
a statistical model, such as created by lm |
... |
further arguments for methods |
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
.
numeric, number of observations
Ott Toomet, otoomet@econ.au.dk
## Do a trivial probit example and find number of observations x <- runif(100) y <- x + rnorm(100) > 0 p <- probit(y ~ x) nObs(p)