tests/test_EstimatorsNested.R

library(plm)
data("Produc", package = "plm")
pProduc <- pdata.frame(Produc, index = c("state", "year", "region"))
form  <- log(gsp) ~ log(pc) + log(emp) + log(hwy) + log(water) + log(util) + unemp
summary(plm(form, data = pProduc, model = "random", effect = "nested"))
summary(plm(form, data = pProduc, model = "random", effect = "nested", random.method = "walhus"))
summary(plm(form, data = pProduc, model = "random", effect = "nested", random.method = "amemiya"))

pProduc_unbal <- pProduc[-c(2, 20:45, 75, 83:85, 500:510, 632:688, 700, 750), ]
summary(plm(form, data = pProduc_unbal, model = "random", effect = "nested"))
summary(plm(form, data = pProduc_unbal, model = "random", effect = "nested", random.method = "walhus"))
summary(plm(form, data = pProduc_unbal, model = "random", effect = "nested", random.method = "amemiya"))

Try the plm package in your browser

Any scripts or data that you put into this service are public.

plm documentation built on Sept. 21, 2021, 3:01 p.m.