[R-sig-ME] Doubt about including random effects or not

Ben Bolker bbolker at gmail.com
Mon Nov 11 22:29:18 CET 2013


On 13-11-11 07:45 AM, V. Coudrain wrote:
> Dear all,
> 
> I collected insects in 30 sites, 15 sites each with a level of
> isolation and all 30 sites are arranged along a gradient of habitat
> amount. Each insect species has a specialization value. I would like
> to test if specialization increases along the gradient of habitat and
> differs between isolation level. The number of insect species and 
> individuals differ largely between sites. I have two doubts: should I
> specify site as a random variable? Should I specify insect abundance
> as an offset?
> 
> The model I thought about: lme(specialization~Isolation*habitat
> amount + offset(insect abundance) , random~1|Site)
> 
> However I am not sure about using site as a random effect and
> specifically if it makes sense to mix offset and random effect.
> 
> Thank you!
> 
> Valérie Coudrain 

  You can mix offsets and random effects: see e.g. the Owls example at
https://groups.nceas.ucsb.edu/non-linear-modeling/projects (although
this is also zero-inflated, which adds an additional level of complexity
you don't need).  A couple of comments though:

 * I don't quite understand why you don't just calculate average
specialization per site; presumably Isolation and habitat amount are
site-level covariates?  If you have different sample sizes per site, you
could calculate the mean and std. dev. of specialization and use the
weights= argument to inverse-variance weight ... (see Murtaugh 2007
_Ecology_ for arguments in favor of aggregating when analyzing nested
designs). (It's possible that one of your covariates varies within site,
which would make this aggregation infeasible.)
 * I also don't quite understand why you expect specialization to be
directly proportional to abundance?  Is abundance a species:site-level
covariate, or an overall (site-level) covariate (I think the latter)?  I
would consider just putting insect abundance in as a covariate (i.e.
allow for some dependence, don't require direct proportionality)... ?

  Ben Bolker



More information about the R-sig-mixed-models mailing list