I'm working with an unbalanced panel dataset. (Country-Time) of approximate dimensions H=100 individuals i and average time length over individuals $mean(T_i)\approx7.5$. And about n= 8 regressors (appart from the fixed effects dummies).
I want to use the Durbin-Watson panel generalization from Bhargava, Alok, Luisa Franzini, and Wiji Narendranathan. "Serial correlation and the fixed effects model." The Review of Economic Studies 49.4 (1982) 533-549 (http://restud.oxfordjournals.org/content/49/4/533.short)
$d_P = \frac{ \sum_{i=1}^H \sum_{t=2}^T \left( \tilde{u}_{it} - \tilde{u}_{it-1} \right)^2 }{ \sum_{i=1}^H \sum_{t=1}^T \tilde{u}_{it}^2 }$
Critical values are given in the paper and are dependent on (T, H, n) with n the number of regressors. Which i linearly interpolate. $cv(7.5, 100, 8) \to d_{PL}=1.8561,\; d_{PU}=1.9039$
Now if i simulate data without autocorrelation I tend to find very low values for $d_P$ that reject $H0: \rho=0$
#[R]
require(data.table)
set.seed(1)
DT <- data.table(i=c(rep(1:50, each=7), rep(51:100, each=8)),
t=c(rep(1:7, 50), rep(1:8, 50)), u=rnorm(100*7.5))
DT[, ':='(du2=c(NA, diff(u))^2, u2=u^2), by=i] # difference by individual
# i t u du2 u2
# 1: 1 1 -0.6264538 NA 0.39244438
# 2: 1 2 0.1836433 0.6562573681 0.03372487
# 3: 1 3 -0.8356286 1.0389152808 0.69827518
# 4: 1 4 1.5952808 5.9093205817 2.54492084
# ---
#746: 100 4 -1.3457937 0.1434371834 1.81116064
#747: 100 5 1.0336654 5.6618254864 1.06846414
#748: 100 6 -0.8117765 3.4056556180 0.65898102
#749: 100 7 1.8017255 6.8303923814 3.24621470
#750: 100 8 1.7715420 0.0009110448 3.13836092
DT.sumT <- DT[, list(sumdu2=sum(du2, na.rm=T), sumu2=sum(u2)), by=i] #sum over T_i
# i sumdu2 sumu2
# 1: 1 12.239715 4.688696
# 2: 2 8.925133 8.698205
# 3: 3 2.463443 4.030220
# ---
d_P <- DT.sumT[, sum(sumdu2)/sum(sumu2)] #sum over i
d_P # Durbin-Watson Statistic
# 1.708489
# next in seed gives --> 1.617848, 1.735762, 1.614137
Which are all < 2 so positive autocorrelation and all simulated $d_P< d_{PL}$ so 5% significant. But the data is IID...
If a negative correlation of 0.2 is forced the test does flip side but still looks downward biased:
DT[, u:=u-0.2*c(0, u[1:(length(u)-1)])]
# d_P --> 2.038816
Am I missing something here? The tabulated 5%c.v. are for T=6 and T=10 so the short+wide property should not be a problem. Also balancing the simulation to e.g. $T_i=T=7$ gives low $d_P$
pbnftest()
. $\endgroup$