Closed SinaDavid closed 7 years ago
Hi Sina,
I agree with you, the results should be the same.
However, I can't reproduce the problem. Please see the two examples below, which are slight modifications of ./spm1d/examples/stats1d/ex_ttest2.py. These two examples produce the same p values (0.031).
If these two examples don't solve your problem, please let me know, and please copy code which replicates the error.
Example 1:
dataset = spm1d.data.uv1d.t2.PlantarArchAngle()
YA,YB = dataset.get_data()
t = spm1d.stats.ttest2(YB, YA, equal_var=True)
ti = t.inference(0.05, two_tailed=True)
Example 2 (data multiplied by -1):
dataset = spm1d.data.uv1d.t2.PlantarArchAngle()
YA,YB = dataset.get_data()
YA,YB = -YA, -YB
t = spm1d.stats.ttest2(YB, YA, equal_var=True)
ti = t.inference(0.05, two_tailed=True)
Cheers,
Todd
Hi Sina,
My response above pertains to the Python version, which appears to be working fine. The MATLAB version does indeed have a problem, thank you so much for finding this bug! Please find that I've replicated this issue in spm1d's MATLAB forum:
https://github.com/0todd0000/spm1dmatlab/issues/31
I'll close the issue here in the Python forum, please use the link above to follow-up on the issue.
Cheers, Todd
Hey Todd, I just recognized something I can't explain: If I compare datasets via ttest2 in a two-tailed approach, I get an p_value of 0.021 If I change die orientation of my datasets by simply multiplying them by -1 (need to do this for some figures), and than recalculate the p-value, it changes to 0.047. In my opinion there shouldn't be a difference, but probably I'm wrong. Thanks in advance! Sina