Description Usage Arguments Details Value Note Author(s) See Also Examples
This function checks for each variable of a panel if it varies cross-sectionally and over time.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
x |
a |
... |
further arguments. |
index |
see |
For (p)data.frame and matrix interface: All-NA columns are removed prior to calculation of variation due to coercing to pdata.frame first.
An object of class pvar
containing the following
elements:
id.variation |
a logical vector with |
time.variation |
a logical vector with |
id.variation_anyNA |
a logical vector with |
time.variation_anyNA |
a logical vector with |
pvar
can be time consuming for “big” panels. As a fast alternative
collapse::varying()
from package collapse could be used.
Yves Croissant
pdim()
to check the dimensions of a 'pdata.frame' (and
other objects),
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Gasoline contains two variables which are individual and time
# indexes and are the first two variables
data("Gasoline", package = "plm")
pvar(Gasoline)
# Hedonic is an unbalanced panel, townid is the individual index;
# the drop.index argument is passed to pdata.frame
data("Hedonic", package = "plm")
pvar(Hedonic, "townid", drop.index = TRUE)
# same using pdata.frame
Hed <- pdata.frame(Hedonic, "townid", drop.index = TRUE)
pvar(Hed)
# Gasoline with pvar's matrix interface
Gasoline_mat <- as.matrix(Gasoline)
pvar(Gasoline_mat)
pvar(Gasoline_mat, index=c("country", "year"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.