Multcompare returning negative p values

조회 수: 5 (최근 30일)
Sophie Dewil
Sophie Dewil 2022년 12월 11일
댓글: the cyclist 2022년 12월 12일
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