Compute clustered standard errors.
A model fit with
A character string naming the grouping/cluster variable.
A data frame containing
coeftest (lmtest) but with clustered standard errors.
clusterSE does not work with models fit with
lm, however a similar model
can be fit with
plm using the option
model = "pooling". You can then
clusterSE to compute clustered standard errors and retest the coefficients.
Jonah Gabry <[email protected]>
1 2 3 4 5 6 7 8 9
## Not run: # Model from plm help page: data("Produc", package = "plm") fit <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc, index = c("state","year"), model = "random") clusterSE(fit, cluster.var = "state") # don't need data argument since "state" is included in index ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.