Skip to content

help structuring mixed model using lmer()

6 messages · Simon Pickett, Douglas Bates, Mark Difford +1 more

#
On Tue, Mar 10, 2009 at 10:15 AM, Simon Pickett <simon.pickett at bto.org> wrote:

            
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.
#
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.
#
Hi Simon,

Have a look at Chap. 11 of "An Introduction to R" (one of R's manuals),
which explains the different ways of specifying models using formulae.

Briefly, y ~ x1 * x2 expands to y ~ x1 + x2 + x1:x2, where the last term
(interaction term) amounts to a test of slope. Normally you would read its
significance from F/chisq/p-value. Many practitioners consider the L.Ratio
test to be a better option. For the fixed effects part in lmer() do:

mod1 <- y ~ x1 + x2  == y ~ x1 + x2
mod2 <- y ~ x1 * x2  == y ~ x1 + x2 + x1:x2

anova(mod1, mod2)

This will tell you if you need to worry about interaction or whether slopes
are parallel.

Regards, Mark.
Simon Pickett-4 wrote:

  
    
#
Hi Simon,

Have a look at Chap. 11 of "An Introduction to R" (one of R's manuals),
which explains the different ways of specifying models using formulae.

Briefly, y ~ x1 * x2 expands to y ~ x1 + x2 + x1:x2, where the last term
(interaction term) amounts to a test of slope. Normally you would read its
significance from F/chisq/p-value. Many practitioners consider the L.Ratio
test to be a better option. For the fixed effects part in lmer() do:

mod1 <- y ~ x1 + x2  == y ~ x1 + x2
mod2 <- y ~ x1 * x2  == y ~ x1 + x2 + x1:x2

anova(mod1, mod2)

This will tell you if you need to worry about interaction or whether slopes
are parallel.

Regards, Mark.
Simon Pickett-4 wrote:

  
    
#
Mark Difford <mark_difford <at> yahoo.co.uk> writes:
... except that you'd better hope that you have a large number
of random units (years? I forget now), or the LR test will be
unreliable -- see Pinheiro and Bates 2000, and refer further questions
to the r-sig-mixed-models list ...

  cheers
    Ben Bolker