[R-sig-Geo] consider spatial autocorrelation in negative binomial regression using spatial eigenvector mapping

Lata Rafael Rafael.Lata.fl at ait.ac.at
Wed Aug 1 16:04:22 CEST 2012


Hello Lars,

Concerning your question on how to test for spatial autocorrelation in negative binomial models you should have look on the paper of Lin and Zahng (2007) that provide some log-linear test for residuals of a loglinear model under the asymptotic normality assumption, such as for instance the Poisson family and therefore also Negative Binomial. There is no function in R but can relatively easily be computed (It has also been applied in Scherngell and Lata 2012)

References:
Schergell and Lata 2012 http://onlinelibrary.wiley.com/doi/10.1111/j.1435-5957.2012.00419.x/abstract

Lin and Zhang 2007 http://onlinelibrary.wiley.com/doi/10.1111/j.1538-4632.2007.00705.x/abstract

Rafael

-----Ursprüngliche Nachricht-----
Von: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-project.org] Im Auftrag von lars mewes
Gesendet: Mittwoch, 01. August 2012 11:20
An: r-sig-geo at r-project.org
Betreff: [R-sig-Geo] consider spatial autocorrelation in negative binomial regression using spatial eigenvector mapping

Dear list,


 I am working on my bachelor thesis in economic geography. For that reason, I'm relatively new to spatial statistics. I hope I can clearly point out, where my problem seems to be.


 I try to examine whether public funding has a significant impact on regional patenting activity or not. In this context, I'm using a cross sectional data set out of 150 German labor market regions, which contains patent counts, values of the public subsidies and some other control variables for each of the regions. Since the values of the dependent variable are counts and there exists over-dispersion, I first used glm.nb {pscl} to run a negative binomial regression.


 To generate more robust results, I want to consider the spatial effects within the data. As far as I know, doesn't exist any appropriate way to test for spatial autocorrelation (SAC) in generalized linear models, regarding the following post:


 <
http://r-sig-geo.2731867.n2.nabble.com/how-to-find-observed-Moran-s-I-value-using-moran-test-spdep-td5203212.html>



 But to check whether there is little evidence of SAC, I used lm.morantest {spdep} with a simple inverse distance calculation:


 > spamr<-readOGR(.) #reading in the *.shp file to calculate the inverse distance matrix.

> coords <- coordinates(spamr)

> spamr_knn<-knn2nb(knearneigh(coords))

> all.linked<-max(unlist(nbdists(spamr_knn,coords)))

> spamr_dn<-dnearneigh(coords,0,all.linked)

> idlist<-nbdists(spamr_dn,coords)

> idlist<-lapply(idlist,function(x) 1/x)

> idlistw<-nb2listw(spamr_dn,glist=idlist)

> nb_mach<-glm.nb(pat_mach~bmbf_mach+publ_mach+rand_mach+den+wo)

> lm.morantest(nb_mach,idlistw)



To see the results:



Global Moran's I for regression residuals



data:

model: glm.nb(formula = pat_mach ~ bmbf_mach + publ_mach + rand_mach +

den + wo, init.theta = 2.338390767, link = log)

weights: idlistw



Moran I statistic standard deviate = 2.6353, p-value = 0.004203

alternative hypothesis: greater

sample estimates:

Observed Moran's I        Expectation           Variance

       0.138220997       -0.008031996        0.003079876



To implement a spatial regression for generalized linear models, I read the article of Dorman et al. (2007) and found the spatial eigenvector mapping very interesting. For that reason I want to use the ME ( ) function {spdep} to account for the spatial effects. But  ME ( ) does not fit for negative binomial regression and the option family="binomial" only can use values of the dependent variable between 0 and 1.


 I also took notice of the following post (
http://r-sig-geo.2731867.n2.nabble.com/ME-function-for-negative-binomial-td7278253.html)
but I really don't understand it.


 So after a long discussion, my questions to the list are:


 (1) Does there exist an appropriate way to consider SAC in negative binomial models within the ME () function?


 (2) Is there another, maybe more appropriate method to consider SAC in negative binomial models?


 Any help is very appreciated. Thank you very much!


 Cheers,

Lars.

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list