Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am working with GWR to identify if there are any relationships between 'extreme' events and disease incidence. The use of GWR has been employed because I am working in a region where local differences occur for for selected variables. It is slightly different to trying to find all the variables that explain the incidence rates, rather I am looking at specific variables to see if they do impact or not.

I am getting good results for the St. Residuals, local r2 and coefficient rasters, however I am concerned about the results in the results box. I've read the literature about these results and it says for the residualsquares and sigma the smaller the value the better. My results for these two measures aren't what I would consider small. Is this vital or are the results I actually map more important? The AICc value is lower for GWR than OLS. I feel positive about the st. residuals, local r 2 and coefficient rasters but don't want to put these in results in my work if actually underlying those the model is no good.

Also, I know it is advised to start with OLS to find a good model, but is this essential if I am not looking to explain the incidence rates fully, rather I am looking to see if the selected variables do impact the incidence rate or not.

Thanks

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

I would highly recommend not taking ESRI's advice on how to conduct a statistical analysis. The place to start is exploring your data by checking distributional assumptions, testing for outlyers, ect... Part of this exploratory process can be testing for autocorrelation. This can be done by explicitly testing the dependent variable or by fitting a preliminary regression and testing the residuals. If you observe autocorrelation or see structure in your residuals then you can run a test for local autocorrelation (i.e., LISA). If you, in fact, have 2nd order spatial effects then you can make the decision to use GWR. Although, the GWR method is quite suspect and can behave in unexpected ways. If you observe 2nd order effect I would recommend looking into nonparametric or semiparametric methods. ArcGIS does not provide the tools for adequately assessing a linear model. It is essential that you assess regression diagnostics (e.g., residual QQ-plot) to ensure that your model is valid. Beyond cursory exploration of your data statistical analysis should be conducted in a software designed for it. My preference is R but there are many good options with much more shallow learning curves. Here is some example R code to get you started. You will notice that this data is not well behaved. I am not including model fit (e.g., transformations, etc...) in the example code, just how I would start the modeling process. Let me know if you would like code for assessing 2nd order effects (local autocorrelation).

# ADD REQUIRED PACKAGES
require(sp)
require(spdep)
require(car)
require(MASS)

# I AM GOING TO USE AN INTERNAL DATASET SO YOU CAN RUN THE CODE
data(meuse) 
  str(meuse)
  summary(meuse)

#####################################
#  DISTRIBUTION PLOT OF y (cadmium) #
#####################################
d <- density(meuse$cadmium)
  plot(d, type="n", main="Distribution of Dependent Variable", 
       xlab="Y", ylab="pdf")
    polygon(d, col="blue")

####################################################################   
#     FIT MULTIPLE LINEAR REGRESSION & ASSUMPTION DIAGNOSTICS      #
####################################################################
summary( fit <- lm(cadmium ~ copper+lead+zinc+elev, data=meuse) ) 
  # TYPE II ANOVA OF FIT MODEL
  Anova(fit, type="II", test.statistic="Wilks", error.estimate="pearson")

# STANDARD REGRESSION PLOTS  
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
  plot(fit, las = 1)    
par(opar)

# BONFERONNI P-VALUE FOR EXTREME OBSERVATIONS
outlierTest(fit) 

# QQ PLOT OF STUDENTIZED RESIDUALS
qqPlot(fit, pch=19, main="QQ-plot") 

# COLINEARITY - MODEL VARIANCE INFLATION FACTORS
vif(fit) 
  sqrt(vif(fit)) > 2 

# COOK'S DISTANCE PLOT - IDENTIFY D > 4/(n-k-1)
cutoff <- 4/((nrow(meuse)-length(fit$coefficients)-2))
  plot(fit, which=4, cook.levels=cutoff, main="Cook's Distance")

# INFLUENCE PLOT (ESCAPE OUT)
influencePlot(fit, id.method="identify", main="Influence Plot", 
           sub="Circle size is proportial to Cook's Distance" )

####################################################################   
#      TEST FOR GLOBAL AUTOCORRELATION IN DEPENDENT VARIABLE       #
####################################################################    
# CREATE sp OBJECT FROM X,Y COORDS IN MEUSE DATAFRAME       
coordinates(meuse) <- ~x+y
  proj4string(meuse) <- CRS("+init=epsg:28992") 

# CREATE NEIGHBORS MATRIX (ALL LINKAGES)
nm <- knn2nb(knearneigh(meuse))
  all.linked <- max(unlist(nbdists(nm, meuse)))
    nb <- dnearneigh(meuse, 0, all.linked)
      colW <- nb2listw(nb, style="W")

# PERMUTATION TEST FOR MORAN'S-I
n=999
( Iperm <- moran.mc(meuse@data[,"cadmium"], listw=colW, nsim=n, 
                    alternative="greater") )
  mean(Iperm$res[1:nsim])
    var(Iperm$res[1:nsim])
  plot(Iperm)

###################################################################################
# MORAN'S-I & LAGRANGE DIAGNOSTICS FOR SPATIAL DEPENDENCE IN LINEAR MODELS 
#
# Reference: 
#   Anselin, L., Bera, A.K., Florax, R. and Yoon, M.J. (1996) Simple diagnostic tests 
#     for spatial dependence. Regional Science and Urban Economics (26)77–104.
###################################################################################

# Moran's-I on regression residuals 
lm.morantest(fit, nb2listw(nb, style="W"))

# Lagrange spatial dependence test
lm.LMtests(fit, nb2listw(nb), test=c("LMerr", "LMlag", "RLMerr",
           "RLMlag", "SARMA"))

# Lagrange spatial dependence test on residual error
lm.LMtests(residuals(fit), nb2listw(nb))  
share|improve this answer
    
In regard to GWR I would recommend reading Paez et. al., (2011). envplan.com/abstract.cgi?id=a44111 –  Jeffrey Evans Oct 10 '12 at 16:15
    
Thank you both for your advice. This may seem a daft question but what are 2nd order spatial effects? I am new to regression so unsure on all the terminology. Thanks again. –  l.s Oct 19 '12 at 13:22
1  
A 1st order effect is a trend that occurs globally in your data. Whereas, a 2nd order effect represents local variation. This is commonly referred to as nonstationarity in spatial statistics. Methods such as GWR are specifically attempt to model the local variation, at the cost of the global trend. –  Jeffrey Evans Oct 19 '12 at 18:52
    
Thanks, Jeffrey. I had heard of nonstationarity so that makes it clearer now. –  l.s Oct 20 '12 at 14:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.