Description Usage Arguments Details Value Note Author(s) See Also Examples
View source: R/tool_pdata.frame.R
This function checks the number of individuals and time observations in the panel and whether it is balanced or not.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | pdim(x, ...)
## Default S3 method:
pdim(x, y, ...)
## S3 method for class 'data.frame'
pdim(x, index = NULL, ...)
## S3 method for class 'pdata.frame'
pdim(x, ...)
## S3 method for class 'pseries'
pdim(x, ...)
## S3 method for class 'panelmodel'
pdim(x, ...)
## S3 method for class 'pgmm'
pdim(x, ...)
## S3 method for class 'pdim'
print(x, ...)
|
x |
a |
... |
further arguments. |
y |
a vector, |
index |
see |
pdim
is called by the estimation functions and can be also used
stand-alone.
An object of class pdim
containing the following
elements:
nT |
a list containing |
Tint |
a list containing two vectors (of type integer): |
balanced |
a logical value: |
panel.names |
a list of character vectors: |
Calling pdim
on an estimated panelmodel
object
and on the corresponding (p)data.frame
used for this
estimation does not necessarily yield the same result. When
called on an estimated panelmodel
, the number of
observations (individual, time) actually used for model
estimation are taken into account. When called on a
(p)data.frame
, the rows in the (p)data.frame
are
considered, disregarding any NA values in the dependent or
independent variable(s) which would be dropped during model
estimation.
Yves Croissant
is.pbalanced()
to just determine balancedness
of data (slightly faster than pdim
),
punbalancedness()
for measures of
unbalancedness,
nobs()
,
pdata.frame()
,
pvar()
to check for
each variable if it varies cross-sectionally and over time.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # There are 595 individuals
data("Wages", package = "plm")
pdim(Wages, 595)
# Gasoline contains two variables which are individual and time
# indexes and are the first two variables
data("Gasoline", package="plm")
pdim(Gasoline)
# Hedonic is an unbalanced panel, townid is the individual index
data("Hedonic", package = "plm")
pdim(Hedonic, "townid")
# An example of the panelmodel method
data("Produc", package = "plm")
z <- plm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp,data=Produc,
model="random", subset = gsp > 5000)
pdim(z)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.