Dear everyone:
When we run the sptial autoregressive models in R,there are no Pseudo r squares in the output,but we may use the likelihood based Nagelkerke measure.Of course, Nagelkerke is one possibility, but not the only one.What I asked professor Bivand and professor Bivand replied is given below.
Hope this helps.
Best wish.

 
Dear professor Bivand,

Thank you very much for your letter.Can I use the non-spatial regresion 
functions R2 = SSreg/SStot (Sum of Squares is additive: SStot = SSreg + 
SSerr) to calculate Pseudo r squares ? Of course, I will use predict and 
residuals value of spatial atuoregressive models to calculate SSreg or 
SStot.Or may I also use the function R2 is the square of the coefficient of 
correlation between dependent variables and independent variables in the 
spatial atuoregressive models output to calculate Pseudo r squares?
 
Best regards,
 
Thanks a lot again.

Professor Bivand reply:
 
None of these is strictly appropriate in academic work - use AIC or log 
likelihood values for comparison. You may use the likelihood based Nagelkerke 
measure if you like, it is based on comparing the log likelihood of the null 
model (OLS of the same model) with the log likelihood of the fitted model - 
it looks something like (for obj as the fitted model):

NK <- function(obj) {
    n <- length(obj$residuals)
    nullLL <- logLik(obj$lm.model)
    c(1 - exp(-(2/n)*(obj$LL - nullLL)))
    }

 (unchecked).

 On checking, this is wrong. The nullLL should be the LL of the null model, 
so logLik(lm(y ~ 1)), which isn't available in the fitted model object. So

NK <- function(obj, y) {
     n <- length(obj$residuals)
     nullLL <- logLik(lm(y ~ 1))
     c(1 - exp(-(2/n)*(logLik(obj) - nullLL)))
      }
 will give the Nagelkerke measure:

 Nagelkerke NJD (1991) A note on a general definition of the coefficient of determination. Biometrika 78: 691每692.

 The obj argument can also be an lm() fit, for example:

 library(spdep)
 example(errorsarlm)
 NK(COL.errW.eig, COL.OLD$CRIME)
 NK(lm(CRIME ~ INC + HOVAL, COL.OLD), COL.OLD$CRIME)

If you must, use the squared correlation of the fitted values from the model and y, but remember that because this is not a model under independence, this measure is not comparable with that for the non spatial model. To compare, only use log likelihood based measures, then you should be safer. The fact that other software reports an R2 doesn't make it appropriate, just more dangerous. I don't know of any serious simulation studies showing that pseudoR2 can be compared across models - between a lagsarlm() with and without an X variable may be OK, but between lagsarlm() and lm() probably isn't.

The pseudo R2 measures not using the likelihood are inappropriate. 

Hope this helps,

 Roger




	[[alternative HTML version deleted]]

