[R] help structuring mixed model using lmer()

Simon Pickett simon.pickett at bto.org
Tue Mar 10 20:02:03 CET 2009


Cheers,

Actually I was using quasipoisson for my models, but for the puposes of my 
example, it doesnt really matter.

I am trying to work out a way of quantifying whether the slopes (for years) 
are covary with habitat scores.

The more I think about it, the more I am convinced that it isnt possible do 
to that using a glm approach. I think I have to run separate models for each 
site, calculate the gradient, then do a lm with gradient explained by 
habitat score....

Thanks, Simon.




> On Tue, Mar 10, 2009 at 10:15 AM, Simon Pickett <simon.pickett at bto.org> 
> wrote:
>
>> This is partly a statistical question as well as a question about R, but 
>> I am stumped!
>
>> I have count data from various sites across years. (Not all of the sites 
>> in the study appear in all years). Each site has its own habitat score 
>> "habitat" that remains constant across all years.
>
>> I want to know if counts declined faster on sites with high "habitat" 
>> scores.
>
>> I can construct a model that tests for the effect of habitat as a main 
>> effect, controlling for year
>
>> model1<-lmer(count~habitat+yr+(1|site), family=quasibinomial,data=m)
>> model2<-lmer(count~yr+(1|site), family=quasibinomial,data=m)
>> anova(model1,model2)
>
> I'm curious as to why you use the quasibinomial family for count data.
> When you say "count data" do you mean just presence/absence or an
> actual count of the number present?  Generally the binomial and
> quasibinomial families are used when you have a binary response, and
> the poisson or quasipoisson family are used for responses that are
> counts.
>




More information about the R-help mailing list