# Mixed (type III) model ANOVA in R and GraphPad Prism

Consider the following setup: two mouse strains ("KO" and "WT") have been compared in three independent experiments ("E1", "E2" and "E3"). In each experiment, there were two groups corresponding to the two mouse strains compared, and each group consisted of four different mice. There were all in all 8 mice per experiment, and three experiments (total of 4 x 2 x 3 = 24 mice).

The question is, of course, whether the strains differ.

In R, I would do this as follows, given the variables strain and experiment:

a <- data.frame(
response= c(100, 110, 120, 130, 200, 210, 220, 230, 105, 115, 125, 135, 205,
215, 225, 235, 105, 115, 125, 135, 215, 225, 235, 245),
experiment= rep( c( "E1", "E2", "E3" ), each= 8 ),
strain= rep( rep( c( "WT", "KO" ), each= 4 ), 3 ) )

myaov <- aov( response ~ strain + Error( experiment ), data= a )
summary( myaov )


However, I have been asked this question by persons who work on a regular basis with GraphPad Prism. It does feature "repeated measures ANOVA" which is (in the help file) said to be equivalent to random block design, but I find the explanations somewhat confusing:

"Repeated measures" vs. "randomized block" experiments

The term repeated measures is appropriate when you made repeated measurements from each subject.

Some experiments involve matching but not repeated measurements. The term randomized-block describes these kinds of experiments. For example, imagine that the three rows were three different cell lines. All the Y1 data came from one experiment, and all the Y2 data came from another experiment performed a month later. The value at row 1, column A, Y1 (23) and the value at row 1, column B, Y1 (28) came from the same experiment (same cell passage, same reagents). The matching is by row.

Randomized block data are analyzed identically to repeated-measures data. Prism always uses the term repeated measures, so you should choose repeated measures analyses when your experiment follows a randomized block design.

My question: how can I analyse these data using GraphPad Prism? Or, alternatively: does the quoted description fit my case?

• If the only thing you want to know here is how to use GraphPad Prism, this question is off-topic for CV (please see our FAQ). Do you have a more general question about the nature of repeated measures experiments / analyses, or about the terminology? If so, please clarify, if not, this question may need to be closed. Nov 8, 2012 at 16:02
• I did, indeed, read the FAQ, and I still do not think that this question is irrelevant. I have been happy to passively take advantage of stats.stackexchange.com in the context of many questions that, in essence, boil down to "how do I do that in R", even though that this might be better suited to post on stackoverflow (for example, see this question). Also, my main problem is that I am confused with the documentation that I have quoted; does that fit my case? Nov 8, 2012 at 20:59
• "Repeated measures ANOVA" is virtually obsolete, and I am doubtful about GraphPad Prism having R's capabilities with regard to current best statistical practice for this situation. Nov 8, 2012 at 22:15
• Dear @FrankHarrell, if you could elaborate just a tiny bit in an answer (rather than a comment), I would be happy to upvote and accept it. Nov 9, 2012 at 10:15

Repeated measures anova is an old technique that assumes the correlation between any two time points are the same (compound symmetric covariance structure). It also requires a correction to be applied to get correct P-values that account for non-independence of repeated observations within subject. Other approaches work better such as the full likelihood methods of mixed effect models and generalized least squares. R provides many approaches to modeling repeated/longitudinal data and to using realistic correlation structures such as exponential declines over longer time spans. Full likelihood methods are also more robust to missing values that are not missing completely at random. My course notes at http://biostat.mc.vanderbilt.edu/rms have a case study worked out using generalized least squares.

• Thank you! If I may ask -- do you think that my R solution is valid, though? Nov 9, 2012 at 13:04
• Valid, if adjust p-values for correlations. But not optimal. Nov 9, 2012 at 18:38

From your description, I don't think you've really done an experiment where a repeated measures analysis (or the alternatives Frank mentioned) are appropriate.

I'd be inclined to analyze each of your three experiments separately, with an unpaired t test or nonparametric Mann-Whitney test. Then you can report the results of all three experiments (confidence intervals and perhaps p values) and look for consistency. I suspect that reporting three consistent experiments will be more informative than trying to combine all the analysis into one pooled result.

If you wanted to be fancier, you could put all the data into a two-way ANOVA, where genotype is one factor, and experiment is the other. Showing that the interaction P value is high would demonstrate that the experiments are consistent (the difference between genotypes is consistent for all three experiments). But, from your description, there would be no repeated measures (because no mouse was measured more than once).

Write me at support@graphpad.com if you need help implementing either approach in GraphPad Prism.

• Thank you for your answer. The experimentator used a two-way ANOVA (which is not fully correct, since experiment is a random factor, not fixed), and I used the nlme as suggested by Frank Harrell. I prefer to avoid separate tests, since it decreases the statistical power. Also, correct me if I'm wrong, but I do not think that a high p-value can demonstrate anything, because a p-value works only one way (being unable to reject the null hypothesis does not demonstrate it). Nov 14, 2012 at 7:36