Last chance! 50% off unlimited learning
Sale ends in
$param$nObs
in {x}.nObs(x, ...)
## S3 method for class 'default':
nObs(x, \dots)
## S3 method for class 'lm':
nObs(x, \dots)
lm
x$param$nObs
. The lm
-method is based on
qr-decomposition, in the same way as the does summary.lm
.nParam
# 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