# Testing for Spatial Autocorrelation in a Negative Binomial Regression Model

Currently, I am working on a count data set measuring events in a third-order administrative unit. The frequency of events varies for each third-order administrative unit to account for the variability, I am using a negative binomial regression model.

A crude graphical analysis of the residual of the regression indicates that no spatial autocorrelation exists. I would like to find a method to assess spatial autocorrelation in a negative binomial regression model, since a regular test of spatial autocorrelation are not feasible (ex. Global Moran's I).

Do you have any suggestions?

-

## migrated from stackoverflow.comOct 18 '12 at 14:34

This question came from our site for professional and enthusiast programmers.

IMO This is material for crossvalidated.com. –  Roman Luštrik Oct 18 '12 at 13:52
What is a third-order administrative unit? Are they contiguous or do you have gaps? Why do you think that a graphical analysis of residuals vs. spatial lags is "crude"? –  Ari B. Friedman Oct 18 '12 at 15:09

I suspect you can use moran.mc to do a monte-carlo permutation test. Basically, it computes a measure of spatial correlation for your residuals, then randomly reassigns your residuals to your regions and recomputes the measure. Do that 999 times, see where your data measure ranks with your MC measures. If its in the far positive tail, you can say you have significant residual autocorrelation.