discrepancy between the p value obtained in a ttest2 on mac vs windows

5 views (last 30 days)
Hello.
I am working with statistics and doing a ttest2 between 2 vectors.It happens to me that if I do it on windows it gives me p=0 and h=1, while if I do it on osx it gives me p=XXe-49 and h=1.
When I do some research I see that on windows the smallest p_value I can get is XXe-16.
Does anyone have an idea what could be happening?

Answers (1)

dpb
dpb on 22 Aug 2023
Simply differences in underlying OS/compiler floating point rounding/underflow.
Certainly 10^-49 (or 10^-16 or even 10^-10) is close enough to zero to not be practically discernible as such--and I'd certainly put little faith in the "XX" before those exponents being truth.
All is well...
  1 Comment
Walter Roberson
Walter Roberson on 22 Aug 2023
The compiler used for the high-performance libraries going to be a factor. But also, the Windows and Mac computers do not necessarily have the same CPU or the same number of computation cores. These days the Mac might be an Apple Silicon CPU, possibly running R2023b beta (native implementation)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!