[R] nlme, MASS and geoRglm for spatial autocorrelation?

Ruben Roa RRoa at fisheries.gov.fk
Wed Jul 13 15:03:53 CEST 2005

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Beale, Colin
> Sent: 13 July 2005 10:15
> To: Prof Brian Ripley
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] nlme, MASS and geoRglm for spatial autocorrelation?
> My data are indeed bernoulli and not binomial, as I indicated. The
> dataset consists of points (grid refs) that are either locations of
> events (animals) or random points (with no animal present). For each
> point I have a suite of environmental covariates describing 
> the habitat at this point. I was anticipating some sort of function that 
> could run:
> function(present ~ env1 + env2 + env3 + x + y, correlation =
> corSpher(form=~x+y), family = binomial)
> where env1 to env3 are the habitat covariates, x & y the grid refs. If
> my data were normal, I undertand I would use gls() with exactly this,
> but drop the family requirement. As my data are bernoulli this is
> clearly not possible, but I was hoping the analysis may be analagous?
> The eventual aim is to firstly understand which environmental 
> covariates are important in determining presence and then to use habitat maps to
> identify the areas expected to be most important.

This could be done with geoRglm. I did something similar last week, but without
covariates, only the spatial coordinates (i.e. my spatial process had expectation 
equal to a constant). If you are willing to sacrifice some spatial resolution you 
can create cells in your spatial data (say 100 m x 100 m) and in each cell count 
the number of successes in observing your spatial process and the number of trials. 
This will be a binomial problem and it seems to me to be the spatial equivalent of 
logistic regression where the predictor continuous variable is structured in bins 
and then events are counted in those bins. You can move to the R-sig-geo list
if you have questions about geoRglm
Btw, this can also be done in SAS using the glimmix macro.

More information about the R-help mailing list