I performed the one way ANOVA and multiple comparisons to deal with my data. But what's the statistical method of the function "multcompare"? Tukey's or Sidak's or ...
19 views (last 30 days)
Show older comments
I performed the one way ANOVA and multiple comparisons to deal with my data. But what's the statistical method of the function "multcompare"? Tukey's or Sidak's or ...
0 Comments
Accepted Answer
William Rose
on 12 Jan 2026 at 18:47
Edited: William Rose
on 12 Jan 2026 at 19:19
@杰,
[Edit: Correct spelling mistakes.]
multcompare() uses the Tukey-Kramer (also known as honestly significant difference) test by default. You can specify other statistical tests with the optional "CriticalValueType" parameter.
For example,
c = multcompare(stats,"CriticalValueType","bonferroni")
See here for a full list of options. Good luck with your analysis.
1 Comment
William Rose
on 12 Jan 2026 at 19:04
Edited: William Rose
on 12 Jan 2026 at 19:33
Example:
[Edit: I posted my initial comment before it was complete.]
Example:
- Create simulated data set with three groups of 20 normally distributed values. The mean of group 2 is higher than groups 1 and 3.
- Analyze the data with anova1().
- If anova p<0.05, perform multple comparisons. Use the default statistics (Tukey-Kramer). Then repeat using Bonferroni statistics.
- The confidence intervals (columns 3 and 5 of ans) and the p-values (column 6 of ans) for the multiple comparisons are slightly different for the different statistical methods.
rng(42); % for reproducibility of this example
y=randn(20,3)+repmat([0 1 0],20,1); % simulated data, three groups of 20
[p,~,stats]=anova1(y,[],'off'); % perform anova
if p<0.05
multcompare(stats,Display='off')
multcompare(stats,CriticalValueType='bonferroni',Display='off')
end
More Answers (0)
See Also
Categories
Find more on Analysis of Variance and Covariance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!