see edits below
With package plm
, I was wondering why the F statistic displayed by summary()
does not change once I supply a covariance matrix (for robust standard errors). Consider the following code, I do not get a change in the F statistic as calculated by summary()
. However, F statstic calculated by waldtest()
changes:
require(plm)
require(lmtest)
data("Grunfeld")
gp <- plm(inv ~ value + capital,data=Grunfeld,model="pooling")
# summary() and waldtest() yield same F statistic [w/o user supplied covariance matrix]
summary(gp)
waldtest(gp, test="F")
# summary() and waldtest() yield different F statistic [w/ user supplied covariance matrix]
summary(gp, .vcov = plm::vcovHC(gp, "white2"))
waldtest(gp, test="F", vcov=plm::vcovHC(gp, "white2"))
Considering this post about Stata's robust standard erros and comparing the output for the F statistic w/ and w/o robust standard errors there, I feel like the F statistic should change.
This was with plm 1.4 (then stable release).
EDIT: pwaldtest
in the CRAN release 1.6-4 of plm
does that and is now incorporated in summary.plm
thus, simply running one of the following will give the robust F test with adjusted df2 parameter:
summary(gp, vcov = plm::vcovHC(gp, "white2"))
pwaldtest(gp, test="F", vcov = plm::vcovHC(gp, "white2"))
Here is a good reference for robust inference for practitioners: Cameron/Miller, "A Practitioner's Guide to Cluster-Robust Inference", Journal of Human Resources, Spring 2015, Vol.50, No. 2, pp.317-373. http://cameron.econ.ucdavis.edu/research/papers.html
If you look at the source code of plm:::summary.plm
then you see that the first line is: object$fstatistic <- Ftest(object, test = "F")
. Thus, the .vcov
argument is not passed on to plm:::Ftest()
and hence the F-statistic is not affected at all. You could contact the plm
maintainers and ask that this should either be improved or at least pointed out on the manual page. Currently, .vcov
is only used for the partial Wald tests of each coefficients, i.e., corresponding to what lmtest
computes via coeftest(gp, vcov = vcovHC(gp, "white2"))
.