My gene expression data are set up as 24 animals with independent Animal.ID assigned to 3 "Status" groups (8 animals each) based on herd test results. Each status group receives Treatment or No Treatment.

After removing extreme outliers, some treatment groups are unbalanced. My thought was to run a linear mixed effects model to account for the unbalanced groups and have "Animal.ID" as a random effect (instead of Status with only 3 levels) since there are some animal characteristics I can't control for. Is this appropriate or should I stick with a linear regression model and Type III ANOVA?

My mixed effects model:

Gene.mix <- lmer(ddCt ~ Status + Treatment + Status*Treatment + (1|Status:Animal), data=Gene1)

My linear regression model:

Gene.lm <- lm(ddCt ~ Status + Treatment + Status*Treatment, data=Gene1)

1 Answer 1


The first model:

Gene.mix <- lmer(ddCt ~ Status + Treatment + Status*Treatment + (1|Status:Animal), data=Gene1)

will account for repeated measures within each unique combination of Status and Animal. You haven't explained what status is, though I'm guessing that it's the treatment group, but it is included also as a fixed effect and this rarely makes sense. You said there are 3 levels of it, so I would suggest it stays as fixed effect only, since you are clearly interesting in the "effect" of it:

Gene.mix <- lmer(ddCt ~ Status + Treatment + Status*Treatment + (1|Animal), data=Gene1)

You mention that there are unmeasured animal effects that you can't control for - this is part of the reason that there is non-independence (correlations within animals) and which is why we fit random intercepts in the first place.

The second model:

Gene.lm <- lm(ddCt ~ Status + Treatment + Status*Treatment, data=Gene1)

will not account for repeated measures within Animal. If you wanted to use a linear model you would want to fit Animal as fixed effect to handle the repeated measures (not usually a good idea when you have more than a small number of them).

As you've said, mixed models will can handle unabalanced designs.

So I would suggest that you go with the mixed model.

Are you sure the outliers are bad data, and not interesting/extreme data ?

  • $\begingroup$ I apologize, I wasn't clear - "Status" is the result of the herd test results, which results in 3 groups with 8 animals in each group. I have averaged the technical replicates for each animal, so then there are a maximum of 8 biological replicates within each group. I am interested in the effect of "Treatment" on gene expression "ddCt" within these three "Status" groups. $\endgroup$
    – iastatecy
    Jul 7, 2020 at 13:43
  • $\begingroup$ I should also note that each animal can only fall within one status group, which is why I was trying to nest Status:Animal. $\endgroup$
    – iastatecy
    Jul 7, 2020 at 13:54
  • $\begingroup$ OK no worries, but having(1 | Status:Animal) doesn't specify nesting. To specify nesting you would use (1 | Status) + (1|Status:Animal) and that definitely isn't right in your situation. I think (1|Animal) is right here, leaving Status as a fixed effect only. $\endgroup$ Jul 7, 2020 at 14:03
  • $\begingroup$ Great, thank you! The other thing I'm struggling to understand is I've been reading that a random effect should have at least 6 groups. Even though each of the 24 animals aren't technically a group, it's still appropriate to apply it as a random effect in the mixed model? $\endgroup$
    – iastatecy
    Jul 7, 2020 at 14:18
  • $\begingroup$ Ah that is a whole other can of worms ;) Unfortunately there is no black and white rule just various rules of thumb. Remember that the software is going to estimate a variance for the random intercepts assuming a normal distribution. Suppose you had only 2 levels - clearly that would not make any sense. 3 is hardly better. Once you get to 5 or 6 you can start to justify it. What I usually do is to fit the group variable as a fixed effect - which also controls for clustering - and compare it to the model with random effects. If they both give similar insight, happy days. If not, great sadness ! $\endgroup$ Jul 7, 2020 at 14:31

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.