plm (version 1.6-5)

punbalancedness: Measures for Unbalancedness of Panel Data

Description

This function reports two unbalancedness measures for panel data as defined in Ahrens/Pincus (1981).

Usage

punbalancedness(x, ...) "punbalancedness"(x, ...) "punbalancedness"(x, index = NULL, ...) "punbalancedness"(x, ...)

Arguments

x
a panelmodel, a data.frame, or a pdata.frame object,
index
only relevant for data.frame interface, for details see pdata.frame,
...
further arguments.

Value

A numeric vector containing two entries (in this order):

Details

punbalancedness returns two measures for the unbalancedness of a panel data set (called "gamma" ($\gamma$) and "nu" ($\nu$)). If the panel data are balanced, both measures equal 1. The more "unbalanced" the panel data, the lower the measures (but > 0). The upper and lower bounds as given in Ahrens/Pincus (1981) are: $0 < \gamma, \nu \le 1$, and for $\nu$ more precisely $ 1/n < \nu \le 1$, with $n$ being the number of individuals (as in pdim(x)$nT$n).

An application of the first measure ("gamma") is found in e. g. Baltagi/Song/Jung (2002), pp. 488-491, and Baltagi/Chang (1994), pp. 78--87, where it is used to measure the unbalancedness of various unbalanced data sets used for Monte Carlo simulation studies.

There exists also an extension of unbalancedness measures to nested panel structures as developed in Baltagi/Song/Jung (2001), p. 368, but these are not implemented in punbalancedness as of now.

punbalancedness uses output of pdim to calculate the unbalancedness measures, so inputs to punbalancedness can be whatever pdim works on. pdim returns a logical whether a panel data set is balanced or not and detailed information about the number of individuals and time observations (see pdim).

References

Ahrens, H.; Pincus, R. (1981), “On two measures of unbalancedness in a one-way model and their relation to efficiency”, Biometrical Journal, 23(3), pp. 227--235.

Baltagi, Badi H.; Chang, Young-Jae (1994), “Incomplete panels: A comparative study of alternative estimators for the unbalanced one-way error component regression model”, Journal of Econometrics, 62(2), pp. 67--89.

Baltagi, Badi H.; Song, Seuck Heun; Jung, Byoung Cheol (2001), “The unbalanced nested error component regression model”, Journal of Econometrics, 101(2), pp. 357--381.

Baltagi, Badi H.; Song, Seuck H.; Jung, Byoung C. (2002), “A comparative study of alternative estimators for the unbalanced two-way error component regression model”, Econometrics Journal, 5(2), pp. 480--493.

See Also

nobs, pdim, pdata.frame

Examples

Run this code
# Grunfeld is a balanced panel, Hedonic is an unbalanced panel
data(list=c("Grunfeld", "Hedonic"), package="plm")

# Grunfeld has individual and time index in first two columns
punbalancedness(Grunfeld) # c(1,1) indicates balanced panel
pdim(Grunfeld)$balanced   # TRUE

# Hedonic has individual index in column "townid" (in last column)
punbalancedness(Hedonic, index="townid") # c(0.472, 0.519)
pdim(Hedonic, index="townid")$balanced   # FALSE

# punbalancedness on estimated models
plm_mod_pool <- plm(inv ~ value + capital, data = Grunfeld)
punbalancedness(plm_mod_pool)

plm_mod_fe <- plm(inv ~ value + capital, data = Grunfeld[1:99, ], model = "within")
punbalancedness(plm_mod_fe)

# replicate results for panel data design no. 1 in Ahrens/Pincus (1981), p. 234
ind_d1  <- c(1,1,1,2,2,2,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,5)
time_d1 <- c(1,2,3,1,2,3,1,2,3,4,5,1,2,3,4,5,6,7,1,2,3,4,5,6,7)
df_d1 <- data.frame(individual = ind_d1, time = time_d1)
punbalancedness(df_d1) # c(0.868, 0.887)

Run the code above in your browser using DataLab