3
$\begingroup$

My experiment is the following:

In a nutshel:

site ncolonie   Week 1                      Week2                       Week3
-   -           no treatment                3min freeze                 3min freeze
A   7control    remove pieces of paper      remove pieces of paper      remove pieces of paper
A   8treatment  remove pieces of paper      remove pieces of paper      remove pieces of paper
B   8control    remove pieces of paper      remove pieces of paper      remove pieces of paper
B   7treatment  remove pieces of paper      remove pieces of paper      remove pieces of paper

In words:

I have 30 colonies of ants ("id" is colony name) across two different labs ("site", 15 colonies in the first lab, 15 in the other one). In the first experiment ("pre-test"), there is no treatment and I introduce a certain amount (total) of pieces of paper with a bad smell in each nest and measure how many the ants removed after 1h (removed); in the second week ("week2") I put the test ("t") colonies in the freezer during 3min (cold shock, does not kill them but may affect performances), leave them some time to recover then I introduce smelly pieces of paper again in the nest; in the third week ("week3") I put the colonies in the freezer during 3min again, leave them some time to recover then I introduce smelly pieces of paper again.

My model is mod1=glmer(y~treatment*site*week+ (1|id),family=binomial(link=probit))

Here is a repeatable example, I used the same distributions as in the actual data set:

rm(list=ls())
treatment<-as.factor(rep(c("t","c"),45))
id<-as.factor(rep(1:30,3))
site<-as.factor(rep(c(rep("A",15),rep("B",15)),3))
week<-as.factor(c(rep("pre-test",30),rep("week1",30),rep("week2",30)))
removed<-trunc(rnorm(90,79,35))
total<-trunc(rnorm(90,139,30))
y=cbind(removed,total)

library(lme4)
require(car)
mod1=glmer(y~treatment*site*week+(1|id),family=binomial(link=probit))
summary(mod1)

results of the summary

Generalized linear mixed model fit by maximum likelihood (Laplace Approximation)
Family: binomial  ( probit )
Formula: y ~ treatment * site * week + (1 | id)

     AIC      BIC   logLik deviance df.resid 
  1255.6   1288.1   -614.8   1229.6       77 

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.1031 -1.4258  0.0164  1.7890  5.5761 

Random effects:
 Groups Name        Variance Std.Dev.
 id     (Intercept) 0.01919  0.1385  
Number of obs: 90, groups:  id, 30

Fixed effects:
                           Estimate Std. Error z value Pr(>|z|)    
(Intercept)                -0.41424    0.06143  -6.744 1.54e-11 ***
treatmentt                 -0.29816    0.08534  -3.494 0.000477 ***
siteB                      -0.04343    0.08538  -0.509 0.611014    
weekweek1                   0.28284    0.04530   6.243 4.29e-10 ***
weekweek2                   0.08350    0.04583   1.822 0.068447 .  
treatmentt:siteB            0.38427    0.12108   3.174 0.001506 ** 
treatmentt:weekweek1        0.02687    0.06415   0.419 0.675310    
treatmentt:weekweek2        0.23246    0.06448   3.605 0.000312 ***
siteB:weekweek1            -0.01073    0.06403  -0.168 0.866906    
siteB:weekweek2            -0.09807    0.06481  -1.513 0.130241    
treatmentt:siteB:weekweek1 -0.24261    0.09132  -2.657 0.007890 ** 
treatmentt:siteB:weekweek2 -0.06146    0.09260  -0.664 0.506915    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

1) Am I doing this right or should I use something else to analyze my results? (repeated-measure ANOVA? same GLMM but using the removal percentage of the first week as random effect?)

2) Should I worry about overdispersion? (I know there are exceptions for Binomial GLMM but it looks like I am not in the 'binary' category?)

3) Is (1|id) enough to account for overdispersion?

$\endgroup$
2
  • 1
    $\begingroup$ I'm not sure I understand what it is you are trying to do? Are you interested in predicting something? Are you trying to estimate the effect of something? $\endgroup$ Jun 9, 2017 at 15:04
  • 1
    $\begingroup$ Sorry it is unclear, I am trying to estimate the effect of the treatment. I want to know if exposing my ants to 1 and then 2 freezing events affect their ability to perform tasks. $\endgroup$
    – Nakx
    Jun 9, 2017 at 15:06

1 Answer 1

0
$\begingroup$

I removed the data from the pre-treatment and used this analysis:

mod1=glmer(y~treatment*week*site+(1|id),family="binomial")

Assumptions were met and results consistent with the figures. I then compared my levels by using the package lsmeans.

library(lsmeans)
lsmeans(mod1, pairwise ~ treatment | week | site, adjust="none")
$\endgroup$

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.