plm (version 1.6-5)

pwaldtest: Wald-style Chi-square Test and F Test

Description

Wald-style chi-square test and F test of slope coefficients being zero jointly, including robust versions of the tests.

Usage

pwaldtest(x, ...) "pwaldtest"(x, test = c("Chisq", "F"), vcov = NULL, df2adj = (test == "F" && !is.null(vcov) && missing(.df2)), .df1, .df2, ...)

Arguments

x
an estimated model of which the coefficients should be tested (usually of class "plm"),
test
a character, indicating the test to be performed, may be either "Chisq" or "F" for the Wald-style Chi-square test or F test, respectively,
vcov
NULL by default; a matrix giving a variance--covariance matrix or a function which computes such; if supplied (non NULL), the test is carried out using the variance--covariance matrix indicated resulting in a robust test,
df2adj
logical, only relevant for test = "F", indicating whether the adjustment for clustered standard errors for the second degrees of freedom parameter should be performed (see Details, also for further requirements regarding the variance--covariance matrix in vcov for the adjustment to be performed),
.df1
a numeric, used if one wants to overwrite the first degrees of freedom parameter in the performed test (usually not used),
.df2
a numeric, used if one wants to overwrite the second degrees of freedom parameter for the F test (usually not used),
...
further arguments (currently none).

Value

An object of class "htest".

Details

pwaldtest can be used stand--alone with a plm object. It is also used in summary.plm to produce the F statistic.

pwaldtest performs the test if the slope coefficients of a panel regression are jointly zero. It does not perform general purpose Wald-style tests (for those, see waldtest (from package lmtest) or linearHypothesis (from car)).

If a user specified variance-covariance matrix/function is given in argument vcov, the robust version of the tests are carried out. In that case, if the F test is requested (test = "F") and no overwriting of the second degrees of freedom parameter is given (by supplying argument (.df2)), the adjustment of the second degrees of freedom parameter is performed by default. The second degrees of freedom parameter is adjusted to be the number of unique elements of the clustered variable - 1, e. g. the number of individuals - 1.

The adjustment requires the vcov to carry an attribute called "cluster" with a known clustering described as a character (for now this could be either the character "group" or "time"). The vcovXX functions of the package plm provide such an attribute for their returned variance--covariance matrices. No adjustment is done for unknown descriptions in the character of the attribute "cluster" or when the attribute "cluster" is not present. For the adjustment, see e. g. Cameron/Miller (2015), section VII; Andress/Golsch/Schmidt (2013), pp. 126, footnote 4.

References

Wooldridge, J.M. (2010) Econometric Analysis of Cross-Section and Panel Data, 2nd ed., MIT Press, Sec. 4.2.3, pp. 60--62.

Andress, H.-J./Golsch, K./Schmidt, A. (2013), Applied Panel Data Analysis for Economic and Social Surveys, Springer, Heidelberg et al.

Cameron, A. C./Miller, D. L. (2015), "A Practitioner's Guide to Cluster-Robust Inference", Journal of Human Resources, 2015, Vol. 50, No. 2, pp. 317--373; see also the supplements under http://cameron.econ.ucdavis.edu/research/papers.html.

See Also

vcovHC for an example of the vcovXX functions, a robust estimation for the variance--covariance matrix; summary.plm

Examples

Run this code
data("Grunfeld", package = "plm")
mod_fe <- plm(inv ~ value + capital, data = Grunfeld, model = "within")
mod_re <- plm(inv ~ value + capital, data = Grunfeld, model = "random")
pwaldtest(mod_fe, test = "F")
pwaldtest(mod_re, test = "Chisq")

# with robust vcov
pwaldtest(mod_fe, vcov = vcovHC(mod_fe))
pwaldtest(mod_fe, vcov = function(x) vcovHC(x, type = "HC3"))

pwaldtest(mod_fe, vcov = vcovHC(mod_fe), df2adj = FALSE) # w/o df2 adjustment

# example without attribute "cluster" in the vcov
vcov_mat <- vcovHC(mod_fe)
attr(vcov_mat, "cluster") <- NULL # remove attribute
pwaldtest(mod_fe, vcov = vcov_mat)   # no df2 adjustment performed

Run the code above in your browser using DataLab