1
$\begingroup$

I am having trouble using the correct test and r code for my experiment. Essentially I measured insect emergence daily from artificial streams with 3 treatments.:

CONTROL - With 5 replicate streams  
TREAT 1 - With 5 Replicate streams  
TREAT 2 - With 5 Rep streams.  
TREAT 2- With 5 rep streams  

I think what I basically want to do is this: Emergence = Treatment + Day + Treatment*Day

Looking for an effect of treatment on insect emergence over time (day)

Update, I have just ran the model below, but it seems to be dropping a treatment group?

Ran this model:

> model6 <- lmer(Emerg ~ Day + Treatment + Day:Treatment + (Day | Stream), insect)
> summary(model6)

Linear mixed model fit by REML ['lmerMod']
Formula: 
Emerg ~ Day + Treatment + Day:Treatment + (Day | Stream)
   Data: insect

REML criterion at convergence: 2070.8

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.0321 -0.4694 -0.0445  0.3883  4.8618 

Random effects:
 Groups   Name        Variance  Std.Dev. Corr
 Stream   (Intercept) 672.73598 25.9372      
          Day           0.01573  0.1254  1.00
 Residual             594.41059 24.3805      
Number of obs: 224, groups:  Stream, 16

Fixed effects:
                        Estimate Std. Error t value
(Intercept)              68.7060    14.6813   4.680
Day                      -0.7632     0.8106  -0.941
TreatmentControl        -26.5467    20.7625  -1.279
TreatmentFluoxetine     -14.0357    20.7625  -0.676
TreatmentMix            -15.0879    20.7625  -0.727
Day:TreatmentControl      0.6181     1.1464   0.539
Day:TreatmentFluoxetine   1.5500     1.1464   1.352
Day:TreatmentMix          1.3808     1.1464   1.204

Correlation of Fixed Effects:
            (Intr) Day    TrtmnC TrtmnF TrtmnM Dy:TrC Dy:TrF
Day         -0.343                                          
TrtmntCntrl -0.707  0.243                                   
TrtmntFlxtn -0.707  0.243  0.500                            
TreatmentMx -0.707  0.243  0.500  0.500                     
Dy:TrtmntCn  0.243 -0.707 -0.343 -0.172 -0.172              
Dy:TrtmntFl  0.243 -0.707 -0.172 -0.343 -0.172  0.500       
Dy:TrtmntMx  0.243 -0.707 -0.172 -0.172 -0.343  0.500  0.500
> 
$\endgroup$
6
  • 1
    $\begingroup$ what is emergence? $\endgroup$
    – bdeonovic
    Commented Feb 10, 2016 at 1:39
  • $\begingroup$ Insect emergence- emergence of the flying adult from the stream channel $\endgroup$
    – Erinn
    Commented Feb 10, 2016 at 1:41
  • $\begingroup$ so it is a continuous measure? $\endgroup$
    – bdeonovic
    Commented Feb 10, 2016 at 1:42
  • $\begingroup$ I don't see where the repeated measures comes in. You are using the same insects for each treatment? $\endgroup$
    – mandata
    Commented Feb 10, 2016 at 1:50
  • $\begingroup$ also what are streams? $\endgroup$
    – bdeonovic
    Commented Feb 10, 2016 at 1:52

1 Answer 1

1
$\begingroup$

If you measured emergence as a continuous measure I would start with a mixed-effects model, but if the measure is dichotomous (e.g., yes or no) then generalized LMM is the way to start.

I will assume your response variable is continuous. I would use the lmer() function from the lme4 package in R. Your base model could look something like this:

Model <- lmer(Emergence ~ Treat + Day + Treat*Day + (1|Stream_id), data = Data_Frame)   
summary(Model)

You have to tell the model that individual streams have multiple measures by treating it as a random factor (i.e, (1|Stream_id)). The 1|... indicates the model will include a random intercept for individual streams. It looks like you are trying to include a random intercept and slope for the random effect Stream, as a function of the effect of Day, which you would code as (1+Day|Stream) in package lem4.

The reason you are missing a treatment is because it is incorporated into the (Intercept). All of your visible treatments are being compared to the "missing" treatment in the intercept. So, your output does not compare the effect of TreatmentControl and the effect of TreatmentFluoxetine, and so on

I think you are interested in the interaction between Day and Treatment. That is, does the effect of Day on Emergence change depending on the type of Treatment used. If so, a simpler approach may be to use the repeated measures of Day to calculate one response variable, such as rate of emergence or total emergence. Then, a simple anova will tell you if the Treatment type affects the rate of emergence, total emergence, or what have you.

Hope this helps you get started. Good luck.

$\endgroup$
2
  • $\begingroup$ Thanks! My measure of emergence is contentious. Is a mixed effect model the correct way to go, or should it simply be a repeated measures? With day being the repeated measure? Also when I run the model, it seems to drop one of my treatment from the comparisons? $\endgroup$
    – Erinn
    Commented Feb 11, 2016 at 1:34
  • $\begingroup$ Your measure of emergence is likely to inspire debate? $\endgroup$
    – linksys
    Commented Feb 11, 2016 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.