Rdata file of dataset

I have recorded the maximum angle of movement, in terms of degrees, of a mouse limb in response to varying durations of electric stimuli for a number of days before and after an experimental treatment. Day -1 is before treatment, Day 0 is the day of treatment, and the positive days are the days after treatment. There were n = 9 mice that were tested the same way but in two separate cohorts and by two different experimenters (n = 4, n = 5).

The problem is that the data from cohort n = 5 was not recorded on Day -1 and Day 4, and the experiment design of cohort n = 4 added in two extra stimuli durations (1ms, 3ms) that were not recorded in the n = 5 cohort. Is it possible to keep the data from the cohort with missing values included for statistical analysis via a linear mixed model?

I've previously tried using this linear model, in this example analyzing the 1ms stimulus over the course of days with Mice and the Day having random error since the mice are measured repeatedly and the time of testing varied slightly from day to day.

library(lme4, stats)
results.data <- lmer(One ~ Day + (1|Mouse) + (1|Day), data = PeakAngle)
results.null <- lmer(One ~ 1 + (1|Mouse) + (1|Day), data = PeakAngle)
results.anova <- anova(results.data, results.null)

I tried including Experimenter as another variable of random error but kept getting an error saying there wasn't enough levels.

I was expecting no significant difference in the One(1ms) stimulus category compared to the null result but it was.

results.null: One ~ 1 + (1 | Mouse) + (1 | Day)
results.data: One ~ Day + (1 | Mouse) + (1 | Day)
         Df     AIC     BIC logLik deviance  Chisq Chi Df Pr(>Chisq)   
results.null  4  -7.052 -0.2965  7.526  -15.052                            
results.data  5 -13.448 -5.0035 11.724  -23.448 8.3959      1   0.003761 **
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

So either I'm not including enough possible sources of error in my model or it really is significant. Also I'm not sure what the proper Post-Hoc test is since the missing values are not random. Or if trying to include the cohort with missing data is even viable.


1 Answer 1


Ultimately I used glht from the multcomp library. results.data = lmer(One ~ Day + (1|Mouse), data = PeakAngle) summary(glht(results.data, linfct=mcp(Day="Tukey")), test=adjusted("bonferroni"))

mcp(Day = "Tukey") is just to indicate pairwise comparisons, the actual method was Bonferroni

I'm still not 100% sure this is a complete model, no matter what I tried, I wasn't able to add Experimenter as another source of error. I used the Bonferroni method since I had multiple samples which were repeated and the total number of samples was not too large. The significance values seemed to correlate with my predictions so I was moderately satisfied, except for the One ~ Day which I still think is wrong, but after running glht seems to be isolated to a single day so I believe it to be an outlier of some sort.


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.