
>
> Message: 2
> Date: Fri, 16 May 2008 02:36:41 -0000 (UTC)
> From: "Ken Beath" <kjbeath@kagi.com>
> Subject: Re: [R-sig-ME] Binomial GLMM vs GLM question
> To: "Justin Touchon" <jtouchon@bu.edu>
> Cc: r-sig-mixed-models@r-project.org
> Message-ID:
> 	<37086.129.78.64.102.1210905401.squirrel@mail.kjbeath.com.au>
> Content-Type: text/plain;charset=iso-8859-1
>
>> Dear Dr. Bates and other LMER experts,
>>     I am admittedly entry level in my R and mixed-model knowledge,  
>> but
>> I'm hoping that someone can help me and also forgive my lack of
>> insight.  Over 3 years, I monitored survival of 350 egg masses at two
>> ponds.  I thus have one continuous variable (rainfall) and two  
>> discrete
>> variables (year and pond).  My response variable, mortality, is  
>> coded as
>> a two column matrix featuring eggs survived and eggs dead. I'm  
>> primarily
>> interested in the effect of rain on survival, but also if rain has
>> different impacts at the different ponds and how much survival varied
>> over the three years.  Originally, I though I could tackle this  
>> with a
>> binomial GLM, but do I need a binomial GLMM instead, as rainfall and
>> year would be random and pond fixed?  The problem with this is  
>> trying to
>> make biological sense out of the results.  I've spent the last week
>> reading all the past posts about why p-values can't be calculated and
>> all that, which I'm fine with.  But what can I say about the  
>> effects of
>> rainfall or year on egg survival from the variance estimates?  Also,
>> doesn't LMER require that random factors be normally distributed,
>> because my rainfall measurements are far from it.  Is that a problem?
>> Thank you in advance for any advice you can give.
>> -Justin Touchon
>>
>
> I think your misunderstanding the idea of a random effect. This is
> something that is unobserved, causing correlation within a group.  
> In your
> data this might be year or pond but definitely not rainfall which is
> simply a covariate. You have more than one measurement on a pond  
> and more
> than one for each year, so it is likely that there will be correlation
> between them and one way of dealing with this is a random effect. The
> alternative is to use a fixed effects model. In your case, there  
> are only
> 2 and 3 groups, so a fixed effects model is the best approach, so a  
> GLM is
> appropriate. If there were say 20 ponds, a random effects model  
> would be
> much more suitable.
>
> Ken

I think this is a good example of what seems a common problem for  
people using mixed models - How to decide what are the random factors  
and what are the fixed factors.

In your study you have taken repeated measurements on the same ponds,  
as such, observations from each pond across years are not independent  
(observations in pond 1 at t+1 will be correlated with observations  
at t).  If you were only interested in the effect of rainfall on egg  
survival I would suggest you use a mixed model with year and pond as  
random effects (based on a similar eg in Crawley's R Book p605). In  
this case I assume you have measurements on every pond in every year  
and as such these random effects are crossed (not nested).

m1 <- lmer(mort~rainfall + (year|pond), family = binomial, data=  
FieldData0305)
summary(m1)
 From the summary output you can assess the influence of the fixed  
effect to see if the estimate for rainfall (slope estimate) is  
different to zero.

Even if the number of groups (years and ponds) is small it is still  
better to take account of this group variation than ignore it (see  
Gelman and Hill 200&.
 From this model you can also get a feeling for the between year and  
between pond variation by looking at the random effects estimates and  
variances. Obviously you will have some idea if you just plot the  
means for each year and each pond.

If you are also interested in understanding how egg survival differs  
between ponds or between years and if this interacts with rainfall  
then it become less straight forward.

I would suggest that you try

m2 <- lmer(mort~rainfall * year * pond + (year|pond), family =  
binomial, data= FieldData0305)
summary(m2)

In the summary you will have estimates for all three factors and  
their interactions and you can ascertain if these are good  
explanatory variables for egg survival.

You may be able to argue that the correlation between years or  
between ponds is negligible and therefore you can leave out the  
random effect and only use a GLM, but I would be inclined to avoid  
model simplification - but other may suggest otherwise.

Jess


>
>> My model and output are as follows:
>>
>>> LMER.1<-lmer(mort~Pond + (Pond|total_rainfall) + (1|Year),
>> family=binomial, data= FieldData0305)
>>
>>> summary(LMER.1)
>> Generalized linear mixed model fit using Laplace
>> Formula: mort ~ Pond + (Pond | total_rainfall) + (1 | Year)
>>    Data: FieldData0305
>>  Family: binomial(logit link)
>>   AIC  BIC logLik deviance
>>  7657 7680  -3822     7645
>> Random effects:
>>  Groups         Name           Variance Std.Dev. Corr
>>  total_rainfall (Intercept)    21.66535 4.65461
>>                 Pond[T.Ocelot]  6.44297 2.53830  -0.627
>>  Year           (Intercept)     0.74082 0.86071
>> number of obs: 350, groups: total_rainfall, 48; Year, 3
>>
>> Estimated scale (compare to  1 )  4.603433
>>
>> Fixed effects:
>>                Estimate Std. Error z value Pr(>|z|)
>> (Intercept)     -0.4678     1.0173 -0.4598    0.646
>> Pond[T.Ocelot]  -0.9831     0.9330 -1.0538    0.292
>>
>> Correlation of Fixed Effects:
>>             (Intr)
>> Pnd[T.Oclt] -0.648
>>
>> _______________________________________________
>> R-sig-mixed-models@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>

Jessica Stapley
Department of Animal and Plant Sciences,
Alfred Denny Building
Sheffield, S10 2TN, UK
ph +44 (0)114 222 0112; fx +44 (0)114 222 0002
	[[alternative HTML version deleted]]


