Skip to content

DOC: repeated measures, AnovaRM and alternatives fixed effect OLS, MixedLM and GEE #9507

Open

Description

@josef-pkt

AnovaRM is missing adjustment if sphericity fails
#9274

also it requires balanced data

It would be useful to have docs that point out the alternatives for the (old-fashioned) AnovaRM.

quick example using Copilot
#9318 (comment)

example is not very good because p-value for diet is in the neighborhood of 1e-12 (OLS/AnovaRM identical F) to 1e-67 (MixedLM, chi2)

additional usecase
cluster randomized trials #8390

aside: can we get an anova table after MixedLM? wald_test_terms seems to work. #4817

Activity

  1. josef-pkt commented on Feb 12, 2025

    @josef-pkt
    MemberAuthor

    some references

    Gardiner, Joseph C., Zhehui Luo, and Lee Anne Roman. 2009. “Fixed Effects, Random Effects and GEE: What Are the Differences?” Statistics in Medicine 28 (2): 221–39. https://doi.org/10.1002/sim.3478.

    Glantz, Stanton A., Bryan K. Slinker, and Torsten B. Neilands. 2016. Primer of Applied Regression & Analysis of Variance. Third edition. New York Chicago San Francisco Athens London Madrid Mexico City Milan New Delhi Singapore Sydney Toronto: McGraw-Hill Education.

    Vallejo, G., M. P. Fernández, P. E. Livacic-Rojas, and E. Tuero-Herrero. 2011. “Comparison of Modern Methods for Analyzing Repeated Measures Data With Missing Values.” Multivariate Behavioral Research 46 (6): 900–937. https://doi.org/10.1080/00273171.2011.625320.

    Glantz has a good chapter also for the importance of categorical coding in multiway anova with interaction.
    Based on brief skimming, they only use type 1 and type 3 anova, no mention of type 2 anova.
    Some examples in the book might be useful.
    Book found because of graphpad prism docs.
    "two-way anova is difficult, and we use regression in the unbalanced case"

  2. josef-pkt commented on Feb 14, 2025

    @josef-pkt
    MemberAuthor

    Detail with example (adjusted so pvalue for diet is around 0.005 to 0.01

    GEE with "naive" cov_type has the same pvalue (diff around 6e-7) as MixedLM using wald_test_terms in both cases.
    GEE with default robust cov_type has much smaller pvalue.
    fixed effects OLS (group dummies) with cluster cov_type also has a much smaller pvalue than with nonrobust cov_type

  3. josef-pkt commented on Mar 16, 2025

    @josef-pkt
    MemberAuthor

    Difference mixed GLM versus GEE in nonlinear models

    they show that the model is not the same and therefore parameters are for different models

    Neuhaus, J. M., J. D. Kalbfleisch, and W. W. Hauck. 1991. “A Comparison of Cluster-Specific and Population-Averaged Approaches for Analyzing Correlated Binary Data.” International Statistical Review / Revue Internationale de Statistique 59 (1): 25–35. https://doi.org/10.2307/1403572.

    related to #8762 and similar issues
    e.g. Bernoulli/Binomial family with random intercept in linpred has an overdispersed margial (integrated out random effect) distribution and not Bernoulli/Binomial anymore.

    AFAICS related to Wooldridge, the identified parameter is beta / sigma.
    eg. Probit with normal random effect is just Probit with scale of latent variable larger than one (AFAIR)
    If sigma increases, then beta / sigma decreases.

    This might be the story behind Neuhaus et al, but I have not looked at the article.

    update
    another article interpreting GEE versus Mixed

    Hubbard, Alan E., Jennifer Ahern, Nancy L. Fleischer, Mark Van der Laan, Sheri A. Lippman, Nicholas Jewell, Tim Bruckner, and William A. Satariano. 2010. “To GEE or Not to GEE: Comparing Population Average and Mixed Models for Estimating the Associations Between Neighborhood Risk Factors and Health.” Epidemiology 21 (4): 467. https://doi.org/10.1097/EDE.0b013e3181caeb90.

  4. josef-pkt commented on Mar 17, 2025

    @josef-pkt
    MemberAuthor

    two more articles getting researchers from anova to mixed and GEE models
    (I did not look at them)
    both anovarm and manova need notes and see also sections to point to the alternatives

    Ma, Yan, Madhu Mazumdar, and Stavros G. Memtsoudis. 2012. “Beyond Repeated-Measures Analysis of Variance: Advanced Statistical Methods for the Analysis of Longitudinal Data in Anesthesia Research.” Regional Anesthesia & Pain Medicine 37 (1): 99–105. https://doi.org/10.1097/AAP.0b013e31823ebc74.

    Melo, Márcio Braga de, Dimitri Daldegan-Bueno, Maria Gabriela Menezes Oliveira, and Altay Lino de Souza. 2022. “Beyond ANOVA and MANOVA for Repeated Measures: Advantages of Generalized Estimated Equations and Generalized Linear Mixed Models and Its Use in Neuroscience Research.” European Journal of Neuroscience 56 (12): 6089–98. https://doi.org/10.1111/ejn.15858.

  5. josef-pkt commented on Oct 23, 2025

    @josef-pkt
    MemberAuthor
  6. abdykaimova commented on Nov 15, 2026

    @abdykaimova

    hi! I'd like to contribute to this issue. I've been reviewing the notebook comparing AnovaRM, fixed-effects OLS, MixedLM and GEE, and would be interested in helping improve the documentation

    my initial idea is to work on the AnovaRM documentation, clarifying its balanced-data requirement and lack of sphericity correction, and adding references to alternative approaches where appropriate. I can also look into the related MANOVA documentation

    would this be a useful scope for a documentation PR? I'd be happy to work on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions