MATLAB: Matlab Ttest2 changing significance level

significance levelstatistical teststatisticst-testttest2

I have two sets of patient age data that I want to compare with a ttest. The sets of data are of different lengths (one vector is 300 rows, the other is 900 rows), and I know their averages are close (30 and 35). That said, when I run the ttest with the default 0.05 significance level it fails to reject. This would normally be fine, I'll just increase the significance level to see where it eventually agrees with the null hypothesis (that their means and variances are equal). Unfortunately, even if I increase the significance level to 0.9999 it does not change, and I'm wondering if its an issue with my data, with the line of code that I've written, or what.
This is what I wrote originally:
[ha,pa] = ttest2(agepen,agegsw);
I eventually changed it to:
[ha,pa] = ttest2(agepen,agegsw,'alpha',0.999);
And the answers for ha and pa were exactly the same (a ridiculously tiny p value by the way, something times 10^-12). Is it my data set or am I miswriting the code?
Thanks a lot!

Best Answer

One option would be to use the histift function on each data set to see how they are distributed. Other options exist to test that assumption, such as the chi2gof function and others linked to in that documentation.
The Wilcoxon rank-sum test (the ranksum function) is distribution-independent, assuming only that both groups are independent and identically distributed. If it agrees with ttest2, your two groups simply might not be different.
Related Question