nobs {plm} | R Documentation |
This function extracts the total number of 'observations' from a fitted panel model.
## S3 method for class 'panelmodel' nobs(object, ...)
object |
a |
... |
further arguments. |
nobs
is just a wrapper for convenience, it calls pdim(x)$nT$N
and is similiar to lm()
's nobs
.
A single number, normally an integer.
Yves Croissant (for pdim
) and Kevin Tappe (wrapper nobs
)
# estimate a panelmodel data("Produc", package = "plm") z <- plm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp,data=Produc, model="random", subset = gsp > 5000) nobs(z) # total observations used in estimation pdim(z)$nT$N # same information pdim(z) # more information about the dimensions (no. of individuals and time periods)