Description Usage Arguments Value Note Author(s) See Also Examples
Compute clustered standard errors.
1 |
fit |
A model fit with |
cluster.var |
A character string naming the grouping/cluster variable. |
data |
A data frame containing |
Output from 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
use clusterSE
to compute clustered standard errors and retest the coefficients.
Jonah Gabry <jsg2201@columbia.edu>
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.