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!
