First–differencing–based test of serial correlation for (the idiosyncratic component of) the errors in either levels or first–differenced panel models.

pwfdtest(x, ...)

# S3 method for class 'formula'
pwfdtest(x, data, ..., h0 = c("fd", "fe"))

# S3 method for class 'panelmodel'
pwfdtest(x, ..., h0 = c("fd", "fe"))

Arguments

x

an object of class formula or a "fd"-model (plm object),

...

further arguments to be passed on to vcovHC (see Details and Examples).

data

a data.frame,

h0

the null hypothesis: one of "fd", "fe",

Value

An object of class "htest".

Details

As Wooldridge (2010) , Sec. 10.6.3 observes, if the idiosyncratic errors in the model in levels are uncorrelated (which we label hypothesis "fe"), then the errors of the model in first differences (FD) must be serially correlated with \(cor(\hat{e}_{it}, \hat{e}_{is}) = -0.5\) for each \(t,s\). If on the contrary the levels model's errors are a random walk, then there must be no serial correlation in the FD errors (hypothesis "fd"). Both the fixed effects (FE) and the first–differenced (FD) estimators remain consistent under either assumption, but the relative efficiency changes: FE is more efficient under "fe", FD under "fd".

Wooldridge (ibid.) suggests basing a test for either hypothesis on a pooled regression of FD residuals on their first lag: \(\hat{e}_{i,t}=\alpha + \rho \hat{e}_{i,t-1} + \eta_{i,t}\). Rejecting the restriction \(\rho = -0.5\) makes us conclude against the null of no serial correlation in errors of the levels equation ("fe"). The null hypothesis of no serial correlation in differenced errors ("fd") is tested in a similar way, but based on the zero restriction on \(\rho\) (\(\rho = 0\)). Rejecting "fe" favours the use of the first–differences estimator and the contrary, although it is possible that both be rejected.

pwfdtest estimates the fd model (or takes an fd model as input for the panelmodel interface) and retrieves its residuals, then estimates an AR(1) pooling model on them. The test statistic is obtained by applying a F test to the latter model to test the relevant restriction on \(\rho\), setting the covariance matrix to vcovHC with the option method="arellano" to control for serial correlation.

Unlike the pbgtest and pdwtest, this test does not rely on large–T asymptotics and has therefore good properties in ”short” panels. Furthermore, it is robust to general heteroskedasticity. The "fe" version can be used to test for error autocorrelation regardless of whether the maintained specification has fixed or random effects (see Drukker 2003) .

References

Drukker DM (2003). “Testing for Serial Correlation in Linear Panel–Data Models.” The Stata Journal, 3(2), 168-177.

Wooldridge JM (2002). Econometric Analysis of Cross–Section and Panel Data. MIT Press. Sec. 10.6.3, pp. 282–283.

Wooldridge JM (2010). Econometric Analysis of Cross–Section and Panel Data, 2nd edition. MIT Press. Sec. 10.6.3, pp. 319–320

See also

pdwtest, pbgtest, pwartest,

Author

Giovanni Millo

Examples


data("EmplUK" , package = "plm")
pwfdtest(log(emp) ~ log(wage) + log(capital), data = EmplUK)
#> 
#> 	Wooldridge's first-difference test for serial correlation in panels
#> 
#> data:  plm.model
#> F = 1.5251, df1 = 1, df2 = 749, p-value = 0.2172
#> alternative hypothesis: serial correlation in differenced errors
#> 
pwfdtest(log(emp) ~ log(wage) + log(capital), data = EmplUK, h0 = "fe")
#> 
#> 	Wooldridge's first-difference test for serial correlation in panels
#> 
#> data:  plm.model
#> F = 131.55, df1 = 1, df2 = 749, p-value < 2.2e-16
#> alternative hypothesis: serial correlation in original errors
#> 

# pass argument 'type' to vcovHC used in test
pwfdtest(log(emp) ~ log(wage) + log(capital), data = EmplUK, type = "HC3", h0 = "fe")
#> 
#> 	Wooldridge's first-difference test for serial correlation in panels
#> 
#> data:  plm.model
#> F = 123.79, df1 = 1, df2 = 749, p-value < 2.2e-16
#> alternative hypothesis: serial correlation in original errors
#> 


# same with panelmodel interface
mod <- plm(log(emp) ~ log(wage) + log(capital), data = EmplUK, model = "fd")
pwfdtest(mod)
#> 
#> 	Wooldridge's first-difference test for serial correlation in panels
#> 
#> data:  mod
#> F = 1.5251, df1 = 1, df2 = 749, p-value = 0.2172
#> alternative hypothesis: serial correlation in differenced errors
#> 
pwfdtest(mod, h0 = "fe")
#> 
#> 	Wooldridge's first-difference test for serial correlation in panels
#> 
#> data:  mod
#> F = 131.55, df1 = 1, df2 = 749, p-value < 2.2e-16
#> alternative hypothesis: serial correlation in original errors
#> 
pwfdtest(mod, type = "HC3", h0 = "fe")
#> 
#> 	Wooldridge's first-difference test for serial correlation in panels
#> 
#> data:  mod
#> F = 123.79, df1 = 1, df2 = 749, p-value < 2.2e-16
#> alternative hypothesis: serial correlation in original errors
#>