Open AlexS1389 opened 1 year ago
If I may suggest something for this very topic: there is the mmrm package dedicated precisely for this very kind of task, where we can specify the necessary covariance structure, followed by the type-3 joint tests (=AN[C]OVA), either via car::Anova(type=3) or via emmeans::joint_tests().
The "classic" RM-ANOVA makes an unrealistic (so it practically never happens) assumption of the compound symmetry, "telling us" that every patient reacts to treatment in exactly the same manner, i.e. with same slope (no situation when patients improve, deteriorate, don't change etc is allowed with this covariance structure). It's roughly (not exactly!) equivalent to the linear mixed model with random-intercept, which highlights the issue: patients responses differ only by intercepts but never by slopes.
With the mmrm and unstructured, ante-dependence or ar1 (very common in longitudinal studies) covariances this issue is addressed.
The mmrm package is perfectly integrated with the emmeans package (for LS-means), car::Anova (type-2 and type-3 AN[C]OVA), mice (multiple imputation via chained equations) packages, offers the Satterthwaite and Kenward-Roger adjustments for small samples, making a gold standard in clinical trials.
Thanks for your comments! We'll put this request on our roadmap for future feature enhancements. Although, if one of you wants to contribute code to the project that achieves this solution, we'd be happy to review a pull request as well!
First, thank you for this amazing product!
Now let me share a suggestion, based on my experience with analyzing lab data (analysis of blood, classic).
Because we are using the same subjects and measure their parameters in different time points (as the treatment is going), instead of sampling the people from the general population,
we are constantly inheriting the initial variance in value of parameters.
This is why we can have a bit absurd situation and observe that 10 out of 10 patients have a small, but consistent change in parameters and ANOVA is rudely responding with p=0.49.
Probability is telling us that the chance for that is 1 : 1000, while ANOVA will return 1 : 2 (or worse), so which one is (more) true?
I was playing in Excel, simulating 30 people of different initial weight, losing 0-4 lbs (randomly, but always losing weight), 3 times in a row?! and ANOVA would still not be convinced. Imagine that, like throwing a dice 100 times, getting odd number. That would be odd...
For this type of data, RM-ANOVA works like charm and it was initially invented to address this very problem and many publications are using it, although it's 10x less popular than ANOVA.
If you may, please add RM-ANOVA as well, and I think that many users will be happy and that all of us will obtain more meaningful results with our datasets.
There are many options to do RM-ANOVA in R, thus I think it could be done relatively easy.