Correct fitlme posthoc tests for multiple comparisons

조회 수: 36 (최근 30일)
Ken Campbell
Ken Campbell 2024년 12월 18일
댓글: Ken Campbell 2024년 12월 26일
This post helped me work out how to use coefTest to analyze single contrasts for linear mixed effects models.
Does anybody know how to perform a series of contrasts and obtain p-values that are corrected for the multiple comparisons (ideally via Tukey)?

답변 (1개)

UDAYA PEDDIRAJU
UDAYA PEDDIRAJU 2024년 12월 26일
Hi Ken,
To perform post-hoc tests with Tukey's correction for multiple comparisons on a linear mixed effects model "fitlme" in MATLAB, follow these steps:
  • Fit the Linear Mixed Effects Model:
lme = fitlme(data, 'response ~ fixedEffects + (1|randomEffects)');
  • Perform Post-hoc Tests with Tukey's Correction:
[~,~,stats] = anova(lme);
results = multcompare(stats, 'CType', 'tukey-kramer');
  • "CType", set to 'tukey-kramer', applies Tukey's correction for multiple comparisons.
  • "results" will contain the comparison results with adjusted p-values.
This will provide you with Tukey-adjusted p-values for your multiple comparisons.
Let me know if this gives a workaround.
  댓글 수: 1
Ken Campbell
Ken Campbell 2024년 12월 26일
Hi Udaya,
Thanks for thinking about this. Unfortunately, anova only tests the main effects in linear mixed effects models. I want to compare categorical levels with a factor.
I can run individual comparisons via coefTest but only for one contrast at a time. If I run several tests in series, I need to correct them for the multiple comparison - hence the original question.
Essentially, I want the multcompare functionality of standard anova but with a linear mixed model design. Sadly, multcompare() does not take lme output.
Ken

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Repeated Measures and MANOVA에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by