Reputation: 1
I applied the DW test to my pooled model in R and I get this error
Error: could not find function "pdwtest"
What's wrong? I installed the package lmtest
.
Upvotes: 0
Views: 701
Reputation: 23788
You are looking at the wrong library. The function pdwtest()
is part of the plm
package, and not of lmtest
. Try this:
install.packages("plm")
library(plm)
data("Grunfeld", package = "plm")
pdwtest(inv ~ value + capital, data=Grunfeld, model="random")
#
# Durbin-Watson test for serial correlation in panel models
#
#data: inv ~ value + capital
#DW = 0.99636, p-value = 2.819e-13
#alternative hypothesis: serial correlation in idiosyncratic errors
Upvotes: 2