Hi Matt,

No bother at all, though in general I would recommend you send messages like this to the list. I'm taking the liberty of cc'ing the list, since your question strikes me as a good one, others may want to weigh in (such as if I say something inaccurate), and this should go in the archives for the benefit of others in the future.

> I have a population of birds breeding in a woodland. Let's use clutch size as an example trait, where there are repeated measures on individuals across space (so individuals move around from year to year). What I am interested in is the fact that birds breeding in similar areas are likely to have similar trait values by virtue of being neighbours and I would like to know the magnitude of these effects.

A couple questions, to be clear:
First, are you measuring "area" as categorical, or do you have unique measurements for each individual's location each year... or both?
Second, if you are treating area as categorical (whether or not you also have unique locations within each area), do you think that neighbouring areas should be similar to each other, or only individuals *within* a given area?
Third, irrespective of the above, do you hypothesise that spatially proximate individuals are similar because they *affect* each other, or because they're exposed to some common characteristic of the local environment that makes them similar?

The answers to all questions may be consequential. In particular, for Q3, if individuals affect each other you have a "spatial lag" or "spatial autoregressive" model, whereas if they are only similar because of "common exposure" you have more what I would call a "spatial error" model.

> As well as this however, I would like to see if the individual-level effects vary across space…so do individual-level differences change as the birds move around.

That implies a random slope for an individual-level covariate, which varies by area (assuming you are treating, or can treat, area as categorical).

> What I envisage is a starting model:
> model1 <- MCMCglmm( clutchsize ~ X1 + sir(~W, units), random=~individual, data=data, prior=prior)
> where W is a connectivity matrix denoting individuals which shared areas and those which did not

This is a spatial lag, not spatial error, model. But from your description, you may want a spatial error model.

> Then what I want to do is to extend this model so that both the individual-level and the residual unit effects vary across space. Does that make sense?

Yes, if I understand you correctly. Again, I think you want a random slope, which varies by (categorical) area.

Assuming I AM understanding you correctly, depending on your answers to the above three questions, what you want to do may be rather challenging. In brief:

Re. Q1: If individuals have *unique* locations in a given year (whether or not you also categorise their locations into "areas" with multiple individuals), you may want to look at another R package--nlme-- which allows for spatial autocorrelation in the errors. However, if you have no more precise locations than categorical "areas", nlme won't work because it needs locations to be unique.
Re. Q2: If you want to allow for spatial autocorrelation *across* areas, you might be able to use MCMCglmm's "ginverse" argument, which allows you to specify a covariance structure for the random effects. But MCMCglmm doesn't allow you to estimate residual autocorrelation in the same way that nlme does (I think…).
Re. Q3: MCMCglmm's "sir" function indeed allows you to look at spatial autoregression… but that may not be what you want.

That may be more information than you wanted, but hopefully something in there will be useful to you. And maybe others will have suggestions.

Cheers,
Malcolm


On 9 May 2012, at 04:58, Matthew Robinson wrote:

> Hi Malcolm,
> 
> I'm really sorry to bother you but I was reading a post on the R-sig-ME list regarding using MCMCglmm for autoregressive lag models, and I was wondering if I could ask for your insight into a problem that I am interested in trying to tackle?
> 
> I have a population of birds breeding in a woodland. Let's use clutch size as an example trait, where there are repeated measures on individuals across space (so individuals move around from year to year). What I am interested in is the fact that birds breeding in similar areas are likely to have similar trait values by virtue of being neighbours and I would like to know the magnitude of these effects. As well as this however, I would like to see if the individual-level effects vary across space…so do individual-level differences change as the birds move around.
> 
> What I envisage is a starting model:
> 
> model1 <- MCMCglmm( clutchsize ~ X1 + sir(~W, units), random=~individual, data=data, prior=prior)
> 
> where W is a connectivity matrix denoting individuals which shared areas and those which did not
> 
> Then what I want to do is to extend this model so that both the individual-level and the residual unit effects vary across space. Does that make sense?
> 
> Thanks very much in advance, any help would be much appreciated.
> 
> Best wishes,
> Matt 
> 
> ------------------------------------------------------
> Dr. Matt Robinson
> NERC Research Fellow
> Department of Animal and Plant Science
> University of Sheffield
> Alfred Denny Building, Western Bank
> Sheffield, S10 2TN, UK
> 
> matthew.r.robinson@sheffield.ac.uk
> 
> tel:  +44 (0)114 222 4707
> fax: +44 (0)114 222 0002
> ------------------------------------------------------
> 
> 
> 


	[[alternative HTML version deleted]]

