This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("plm") | |
data("Grunfeld", package = "plm") | |
## set some observations of the dependent variable to missing | |
Grunfeld$inv[Grunfeld$year<=1936] <- NA | |
fe <- plm(inv ~ value + capital, data = Grunfeld, model = "within") | |
library(sandwich) | |
sandwich::vcovBS(fe, cluster=~firm, R = 999) # errors | |
# Error in vcovBS.default(fe, cluster = ~firm, R = 999) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# speed test matrix splitting by individual subsetting, esp. in | |
# plm::pcce and plm::pmg | |
library("plm") | |
data(Produc) | |
pProduc <- pdata.frame(Produc) | |
X <- as.matrix(pProduc[ , -c(1:3)]) | |
ind <- index(pProduc)[[1L]] |