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])
댓글 수: 0
답변 (1개)
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)
댓글 수: 2
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 Center 및 File Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
