# Goodness of fit for a spatial panel with fixed effects and both spatial lag and spatial error

On a dataset, I performed spatial panel regressions with fixed effects, and with both a spatial lag and a spatial error (both are significant), using package splm in R (Millo and Piras 2012 Journal of Statistical Software). I would like to assess the Goodness of Fit of these models, and this seems to be a tricky issue.

The most detailed treatment of the question that I found so far is in Elhorst (2010): http://regroningen.nl/elhorst/doc/Spatial%20Panel%20Data%20Models.pdf But he discuss spatial lag and spatial error models separately. Therefore, I am not sure if any of the formulas he propose (Table 1 p.24) is appropriate for a model having both spatil lag and error components. And anyway I am not entirely sure of how to practically calculate these formulas with my model output.

So, I'm not sure to understand how I can calculate any measure of goodness of fit for these models.

Calculating directly the squared correlation between the observed values and the fitted values, calculated as the (observed - residuals) gives very high corr2, above 0.9, while calculating the squared correlation between the observed and predicted values, calculated simply using the explanatory variables X multiplied by the beta, gives very low corr2 (like 0.04), as one could expect given that the spatial lag and errors are very significant.

Does anyone have an idea, advice, on how to do that correctly?

Note that I use R package splm rather than Elhorst MATLAB package, because I don't know MATLAB..., but also because splm is the only one which calculates models having both spatial lag and error components together.

Thank you very much

Patrick Meyfroidt University of Louvain, Belgium