[R-sig-Geo] Need help in using spdep package for running spatial models

Roger Bivand Roger.Bivand at nhh.no
Mon Jan 26 18:42:55 CET 2009


On Wed, 21 Jan 2009, Giam Xingli wrote:

> 
> Hi everyone,
> 
> I am new to spatial modeling using R, and I will be grateful for any tip.
> 
> I have an ArcGIS shapefile database of ~800 regions (consisting of ~5000
> polygons) in geographic projection (lat-long). I have a response variable,
> Y, and 4 explanatory variables, X1, X2, X3 and X3. I hope to compare
> single-term GLMs (of X1, X2, X3 and X4 against the null model - on a normal
> distribution, controlling for spatial autocorrelation in all these models).
> 
> >From reading the vignette and spdep package pdf, I understand that the
> spdep package enables me to carry out the analyses. But I am not sure which
> functions I should use - hope someone can guide me.
> 
> Firstly, I intend to determine at which neighborhood distances, (and also
> whether neighborhood coding are weighted or binary) are spatial
> autocorrelation reduced to acceptable levels based on Moran's I.

One reason for you not getting replies so far is that you are mixing up 
two kinds of support: your observations have (multi-) polygon support, but 
you want to use distances between them. What is the distance between one 
collection of polygons and another, especially if members of the 
collections are mixed up? If you think this through, you may realise that 
your possibility of trying to use the "standard" ecological (I suppose) 
correlogram approach is very limited.

Further, AIC-fishing is just that; you lose the properties of the models 
you are trying to fit by "cherry-picking". You can do it, but please take 
account of the fact that it affects your tests of the significance of any 
coefficients. Using single term models (you say GLM, if your response is 
discrete, none of the functions you mention below are applicable), you are 
running the same risk, especially when the covariates covary with each 
other, don't they?

Think though the support question first. There is plenty that can be done, 
but you need to make decisions about how the data are structured and the 
model specified before getting into the detail of choosing functions.

Hope this helps,

Roger

> 
> Secondly, I hope to generate a neighbor list/matrix based on the
> above-mentioned values. Are there any functions that allow me to do that?
> (many of the regions have consist of more than 1 polygon).
> 
> Thirdly, using the neighbourhood list, run SAR (lagged, mixed and err) using
> "lagsarlm" and "errsarlm". Perform model selection as usual using AIC, wAIC
> and %DE.
>
> I would be really grateful, if anyone could comment on the suitability of my
> analytic framework, and point out certain functions I can use (especially
> for the first and second points).
> 
> Thanks for reading this lengthy post.
> 
> Best regards,
> Xingli
> 
> ------------------------------------
> Xingli Giam
> Research Visitor
> Research Institute of Climate Change and Sustainability
> School of Earth and Environmental Sciences
> The University of Adelaide
> Mobile: +61 (0) 425 150 966
> Email: xingli.giam at adelaide.edu.au
> Alt email: giam at nus.edu.sg
> 
> 
> and
> 
> M.Sc. Candidate
> Department of Biological Sciences
> National University of Singapore
> (on study leave till 30 June 2009)
> 
> 
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list