Multcompare returning negative p values

5 次查看(过去 30 天)
Hi all, I ran a four way anova using anovan and am trying to run post hoc tests using the variable "stats" from the anovan output. I've attached the mat file for the stats variable here. I'm running 'multcompare' using the code below and multiple of the interactions are returning negative p values. Any help you can provide with this would be greatly appreciated, thanks!!
[c,m,h,gnames] = multcompare(stats, "Dimension", [1 2])

回答(1 个)

the cyclist
the cyclist 2022-12-12
Note that the negative p-values are all tiny. I expect this is just round-off error.
% Load the data from the uploaded file
load(websave('stats','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1227552/stats.mat'));
% Run analysis
[c,m,h,gnames] = multcompare(stats, "Dimension", [1 2]);
% Display the negative p-values (6th column of c)
c(c(:,6)<0,6)
ans = 9×1
1.0e-07 * -0.4119 -0.4119 -0.4119 -0.4119 -0.4119 -0.4119 -0.4119 -0.4119 -0.4119
  2 个评论
Sophie Dewil
Sophie Dewil 2022-12-12
Thank you so much for your answer! So are you thinking this is actually a legitimate answer and I can just assume these are very significant p values?
the cyclist
the cyclist 2022-12-12
I think it is very unlikely that this is a MATLAB bug, but obviously true p-values cannot be negative. The fact that these are not only negative but also the same negative value suggests to me that maybe there is some level of approximation going on, and this is the result of that, round-off, etc.
In many contexts, I would be ok with quoting these p-values as p < 0.001. That being said, how diligently I followed up on this would also be dependent on context. For "mission critical" analyses, I would at least trace the calculations (using the debugger) to step into the multcompare function and see what is going on. (Sometimes you will be able to see the full calculation, and sometimes you will ultimately be thwarted by hitting something that is built-in and not visible to you.)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Analysis of Variance and Covariance 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by