Dear R users,


I have a Panel data and I've just estimated spatial fixed and random effects models by Maximum likelihood using splm library. Having the estimates for both models,  now I must decide which one is better. I've looked around and I found a Spatial Hausman Test implemented under the name of sphtest in R. But I'm not sure you can use  it for Maximum likelihood estimated models. Does anyone knows hoe to perform this test for ML estimated models? I tried

sarre10307<- spml(formula=basic, data=panel0307, index=c("GEOCODIG_M","ano"), listw=nlist0307, model ="random",  effect =c("individual"),  lag=TRUE, method="eigen", spatial.error="none")
sarfe10307<- spml(formula=basic, data=panel0307, index=c("GEOCODIG_M","ano"), listw=nlist0307, model ="within",  effect =c("individual"),  lag=TRUE, method="eigen", spatial.error="none")

and then
test2<-sphtest(sarre10307, sarfe10307)
Error in if (x$ef.sph == x2$ef.sph) stop("Effects should be different") : 
  argument is of length zero

My dataset is reasonably large, so I apologize for not making the data available so you can reproduce the problem. If  necessary I can reduce my dataset and post it.

Thank you so much!
Rafael Terra
PhD Candidate in Economics - Sao Paulo School of Economics
Sao Paulo, Brazil
email: rflterra@yahoo.com.br

	[[alternative HTML version deleted]]

