sphtest {splm} | R Documentation |
Hausman test for spatial panel data models
Description
Hausman specification test for spatial panel data models
Usage
sphtest(x, ...)
## S3 method for class 'formula'
sphtest(x, data, index = NULL, listw,
spatial.model = c("lag", "error", "sarar"),
method = c("ML", "GM"), errors = c("KKP", "BSK"),...)
## S3 method for class 'splm'
sphtest(x, x2, ...)
Arguments
x |
an object of class |
x2 |
an object of class |
data |
an object of class |
index |
if not NULL (default), a character vector to identify the indexes among the columns of the |
listw |
an object of class |
spatial.model |
one of |
method |
one of |
errors |
one of |
... |
additional arguments to be passed |
Value
an object of class htest
Author(s)
Gianfranco Piras
References
Millo, G., Piras, G. (2012) splm: Spatial Panel Data Models in R. Journal of Statistical Software, 47(1), 1–38. URL http://www.jstatsoft.org/v47/i01/.
See Also
spgm
Examples
data(Produc, package="plm")
data(usaww)
fm <- log(gsp)~log(pcap)+log(pc)+log(emp)+unemp
test1<-sphtest(fm,data=Produc, listw = spdep::mat2listw(usaww),
spatial.model = "error", method="GM")
test1
mod1<- spgm(fm, data=Produc, listw = usaww, model = "random",
spatial.error = TRUE, moments="fullweights")
mod2<- spgm(fm, data=Produc, listw = usaww, model = "within",
spatial.error = TRUE)
test2<-sphtest(mod1, mod2)
test2