Last chance! 50% off unlimited learning
Sale ends in
x$param$nParam
.nParam(x, ...)
## S3 method for class 'default':
nParam(x, \dots)
## S3 method for class 'lm':
nParam(x, \dots)
nObs
for number of observations# 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
summary(m)
nParam(m) # you get 3
Run the code above in your browser using DataLab