The difference is in regulating the degrees of freedom. This is a common first prerequisite when looking for differences in supposedly similar standard errors (see, for example, Various reliable standard logistic regression errors in Stata and R ). Here the problem can be illustrated by comparing the results of (1) plm + vcovHC , (2) felm , (3) lm + cluster.vcov (from the multiwayvcov package).
First I update all the models:
m1 <- plm(y ~ x, data = mydata, index = c("facX", "state"), effect = "individual", model = "within") m2 <- felm(y ~ x | facX | 0 | facX, data = mydata) m3 <- lm(y ~ facX + x, data = mydata)
All lead to the same odds estimates. For m3 fixed effects are explicitly reported until they are for m1 and m2 . Therefore, with m3 only the last coefficient is extracted using tail(..., 1) .
all.equal(coef(m1), coef(m2)) ## [1] TRUE all.equal(coef(m1), tail(coef(m3), 1)) ## [1] TRUE
Non-standard standard errors also agree.
se <- function(object) tail(sqrt(diag(object)), 1) se(vcov(m1)) ## x ## 0.07002696 se(vcov(m2)) ## x ## 0.07002696 se(vcov(m3)) ## x ## 0.07002696
And when comparing cluster standard errors, we can now show that felm uses correction of the degree of freedom, and plm does not:
se(vcovHC(m1))
source share