[R] Spatial Autocorrelation
Hello, I have a matrix with the distances among sites. And I have another matrix with the presence and absence of each species in each site. I would like to test the spatial autocorrelation among sites. I have tried to use the function gearymoran of the ade4 package, but error messages keep popping up. Do you know any function for me to test the spatial autocorrelation of my data? Thanks, Paulo Branco -- View this message in context: http://www.nabble.com/Spatial-Autocorrelation-tp25767010p25767010.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Spatial autocorrelation
Hi, I have collected data on trees from 5 forest plots located within the same landscape. Data within the plots are spatially autocorrelated (calculated using Moran's I). I would like to do a ANCOVA type of analysis combining these five plots, but the assumption that there is no autocorrelation in the residuals is obviously violated. Does anyone have any ideas how to incorporate these spatial effects in my analysis? I have been reading up on autoregressive techniques, but I am not sure if it works with more than one plot. All help is greatly appreciated! Many thanks, Geertje van der Heijden [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Spatial Autocorrelation
Hi Paulo, you may want to take a look at http://cran.r-project.org/web/views/Spatial.html there, you can find all "spatial" packages that can be useful for your question. There is also a a mailing list R-sig-geo that where you can ask all those kind of question. Hope that this helps. Cheers Anna Anna Freni Sterrantino Ph.D Student Department of Statistics University of Bologna, Italy via Belle Arti 41, 40124 BO. Da: P.Branco A: r-help@r-project.org Inviato: Martedì 6 ottobre 2009, 13:28:36 Oggetto: [R] Spatial Autocorrelation Hello, I have a matrix with the distances among sites. And I have another matrix with the presence and absence of each species in each site. I would like to test the spatial autocorrelation among sites. I have tried to use the function gearymoran of the ade4 package, but error messages keep popping up. Do you know any function for me to test the spatial autocorrelation of my data? Thanks, Paulo Branco -- View this message in context: http://www.nabble.com/Spatial-Autocorrelation-tp25767010p25767010.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ spazio gratuito per i tuoi file e i messaggi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Spatial Autocorrelation
Hi Paulo, if your data are distance matrices, you might consider doing a Mantel test, look at the mantel() function in package vegan. While this is not technically measuring spatial autocorrelation, it will test for correlation between the attribute distances and the geographic distances. Also, if you can coax your data back into a point shapefile (for example), you can use the tools in the spdep package which will measure actual spatial autocorrelation (such as Moran's I and Geary's C). Best, Corey silcha wrote: > > Hi Paulo, > you may want to take a look at > > http://cran.r-project.org/web/views/Spatial.html > > there, you can find all "spatial" packages that > can be useful for your question. > There is also a a mailing list R-sig-geo that where > you can ask all those kind of question. > > Hope that this helps. > > Cheers > > Anna > > > > Anna Freni Sterrantino > Ph.D Student > Department of Statistics > University of Bologna, Italy > via Belle Arti 41, 40124 BO. > > > > > ____ > Da: P.Branco > A: r-help@r-project.org > Inviato: Martedì 6 ottobre 2009, 13:28:36 > Oggetto: [R] Spatial Autocorrelation > > > Hello, > > I have a matrix with the distances among sites. And I have another matrix > with the presence and absence of each species in each site. I would like > to > test the spatial autocorrelation among sites. > > I have tried to use the function gearymoran of the ade4 package, but error > messages keep popping up. Do you know any function for me to test the > spatial autocorrelation of my data? > > Thanks, > > Paulo Branco > -- > View this message in context: > http://www.nabble.com/Spatial-Autocorrelation-tp25767010p25767010.html > Sent from the R help mailing list archive at Nabble.com. > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > > __ > > > spazio gratuito per i tuoi file e i messaggi > > [[alternative HTML version deleted]] > > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > -- View this message in context: http://www.nabble.com/Spatial-Autocorrelation-tp25767010p25768890.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Spatial Autocorrelation
In addition to the taskview (below), you might consider using the "sos" package, something like the following: sa <- ???'spatial autocorrelation' # 58 matches sc <- ???'spatial correlation' # 181 matches s. <- sa|sc # union of the to 'findFn' objects summary(s.) # 224 links in 57 packages installPackages(s.) # install packages with at least 5 >= sqrt(max(count)) matches writeFindFn2xls(s.) # write an Excel file with 3 sheets: PackageSum2, findFn, call This tells you that 22 help pages in "spdep" matched the search term, plus 18 pages in each of nlme, ncf, and spatstat, as well as 17 in ramps and 15 in geoR. The "PackageSum2" sheet also provides other information to help you decide which package to consider first. Beyond this, you may like to uses these functions with other search terms; see vignette('sos') for more information. Hope this helps. Spencer Disclaimer: I'm the lead author of "sos". Corey Sparks wrote: Hi Paulo, if your data are distance matrices, you might consider doing a Mantel test, look at the mantel() function in package vegan. While this is not technically measuring spatial autocorrelation, it will test for correlation between the attribute distances and the geographic distances. Also, if you can coax your data back into a point shapefile (for example), you can use the tools in the spdep package which will measure actual spatial autocorrelation (such as Moran's I and Geary's C). Best, Corey silcha wrote: Hi Paulo, you may want to take a look at http://cran.r-project.org/web/views/Spatial.html there, you can find all "spatial" packages that can be useful for your question. There is also a a mailing list R-sig-geo that where you can ask all those kind of question. Hope that this helps. Cheers Anna Anna Freni Sterrantino Ph.D Student Department of Statistics University of Bologna, Italy via Belle Arti 41, 40124 BO. ____________ Da: P.Branco A: r-help@r-project.org Inviato: Martedì 6 ottobre 2009, 13:28:36 Oggetto: [R] Spatial Autocorrelation Hello, I have a matrix with the distances among sites. And I have another matrix with the presence and absence of each species in each site. I would like to test the spatial autocorrelation among sites. I have tried to use the function gearymoran of the ade4 package, but error messages keep popping up. Do you know any function for me to test the spatial autocorrelation of my data? Thanks, Paulo Branco -- View this message in context: http://www.nabble.com/Spatial-Autocorrelation-tp25767010p25767010.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ spazio gratuito per i tuoi file e i messaggi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Spencer Graves, PE, PhD President and Chief Operating Officer Structure Inspection and Monitoring, Inc. 751 Emerson Ct. San José, CA 95126 ph: 408-655-4567 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Spatial autocorrelation
Geertje Van der Heijden wrote: >Hi, > >I have collected data on trees from 5 forest plots located within the >same landscape. Data within the plots are spatially autocorrelated >(calculated using Moran's I). I would like to do a ANCOVA type of >analysis combining these five plots, but the assumption that there is no >autocorrelation in the residuals is obviously violated. Does anyone have >any ideas how to incorporate these spatial effects in my analysis? I >have been reading up on autoregressive techniques, but I am not sure if >it works with more than one plot. > >All help is greatly appreciated! > >Many thanks, >Geertje van der Heijden > > > Hi, one way to remove spatial autocorrelation is to use Moran's Eigenvectors as predictors in multiple regression. But as there are always n-1 vectors for n points, you will have to choose the predictors to be retained (using standard model selection procedures). Here is an example of how to get the eigenvectors using the ade4 and spdep packages. library(ade4) library(spdep) library(adegenet) xy = matrix(rnorm(100),ncol=2) plot(xy) # get a connection network (here, Delaunay triangulation) cn = chooseCN(xy,ask=FALSE,res="listw")$cn # get Moran's Eigenvectors U = orthobasis.listw(cn) # visualize the first 9 vectors par(mfrow=c(3,3)) for(i in 1:9) s.value(xy,U[,i],addaxes=FALSE, include.ori=FALSE) And then you can use the columns of U as spatial predictors in your model. A few vectors should be able to remove the autocorrelation among residuals. Regards, Thibaut. -- ## Thibaut JOMBART CNRS UMR 5558 - Laboratoire de Biométrie et Biologie Evolutive Universite Lyon 1 43 bd du 11 novembre 1918 69622 Villeurbanne Cedex Tél. : 04.72.43.29.35 Fax : 04.72.43.13.88 [EMAIL PROTECTED] http://lbbe.univ-lyon1.fr/-Jombart-Thibault-.html?lang=en http://pbil.univ-lyon1.fr/software/adegenet/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Spatial autocorrelation
Hi Geertje, You should look into linear mixed-effects models. In these you can incorporate spatial correlation explicitly. The basic function to use is lme(), but you should do some reading about this type of models before jumping into it. An excellent resource is the book "Mixed Effects Models in S and S-Plus" by Jose Pinheiro and Douglas Bates. Good Luck! Julian Geertje Van der Heijden wrote: > Hi, > > I have collected data on trees from 5 forest plots located within the > same landscape. Data within the plots are spatially autocorrelated > (calculated using Moran's I). I would like to do a ANCOVA type of > analysis combining these five plots, but the assumption that there is no > autocorrelation in the residuals is obviously violated. Does anyone have > any ideas how to incorporate these spatial effects in my analysis? I > have been reading up on autoregressive techniques, but I am not sure if > it works with more than one plot. > > All help is greatly appreciated! > > Many thanks, > Geertje van der Heijden > > > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Spatial autocorrelation
Hi, On the online Early articles of the Ecography Journal you can find this paper: Dormann et al. 2007: Methods to account for spatial autocorrelation in the analysis of species distributional data: a review. Ecography in press (Online Early). This article describe several methods to account for spatial autocorrelation and include an online appendix with R commands! victor On 10/22/07, Geertje Van der Heijden <[EMAIL PROTECTED]> wrote: > > Hi, > > I have collected data on trees from 5 forest plots located within the > same landscape. Data within the plots are spatially autocorrelated > (calculated using Moran's I). I would like to do a ANCOVA type of > analysis combining these five plots, but the assumption that there is no > autocorrelation in the residuals is obviously violated. Does anyone have > any ideas how to incorporate these spatial effects in my analysis? I > have been reading up on autoregressive techniques, but I am not sure if > it works with more than one plot. > > All help is greatly appreciated! > > Many thanks, > Geertje van der Heijden > > > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Victor Lemes Landeiro Instituto Nacional de Pesquisas da Amazônia - INPA Manaus, Amazonas, Brasil Skype: landeiro (Bloqueado no INPA) Homo notsosapiens (Colin Townsend) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Spatial autocorrelation
Hi, Thanks to everyone for their advice! It was really helpfull. Geertje Geertje van der Heijden PhD student Tropical Ecology School of Geography University of Leeds Leeds LS2 9JT Tel: (+44)(0)113 3433345 Email: [EMAIL PROTECTED] From: Victor Landeiro [mailto:[EMAIL PROTECTED] Sent: 23 October 2007 13:17 To: Geertje Van der Heijden Cc: [EMAIL PROTECTED] Subject: Re: [R] Spatial autocorrelation Hi, On the online Early articles of the Ecography Journal you can find this paper: Dormann et al. 2007: Methods to account for spatial autocorrelation in the analysis of species distributional data: a review. - Ecography in press (Online Early). This article describe several methods to account for spatial autocorrelation and include an online appendix with R commands! victor On 10/22/07, Geertje Van der Heijden <[EMAIL PROTECTED]> wrote: Hi, I have collected data on trees from 5 forest plots located within the same landscape. Data within the plots are spatially autocorrelated (calculated using Moran's I). I would like to do a ANCOVA type of analysis combining these five plots, but the assumption that there is no autocorrelation in the residuals is obviously violated. Does anyone have any ideas how to incorporate these spatial effects in my analysis? I have been reading up on autoregressive techniques, but I am not sure if it works with more than one plot. All help is greatly appreciated! Many thanks, Geertje van der Heijden [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Victor Lemes Landeiro Instituto Nacional de Pesquisas da Amazônia - INPA Manaus, Amazonas, Brasil Skype: landeiro (Bloqueado no INPA) Homo notsosapiens (Colin Townsend) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] spatial autocorrelation for data that are temporally pseudoreplicated
Dear all, I collected my data from the different agricultural fields every week over a period of a month. how can I test for spatial autocorrelation in R with data that are temporally pseudoreplicated? I used lme with correlation=corCompSymm(form=~Date) to model temporal pseudoreplication. Regards, VG __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.