nobs {plm}R Documentation

Extract Total Number of Observations Used in Estimated Panelmodel

Description

This function extracts the total number of 'observations' from a fitted panel model.

Usage

## S3 method for class 'panelmodel'
nobs(object, ...)

Arguments

object

a panelmodel object for which the number of total observations is to be extracted,

...

further arguments.

Details

nobs is just a wrapper for convenience, it calls pdim(x)$nT$N and is similiar to lm()'s nobs.

Value

A single number, normally an integer.

Author(s)

Yves Croissant (for pdim) and Kevin Tappe (wrapper nobs)

See Also

pdim

Examples


# 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)


[Package plm version 1.5-12 Index]