I am trying to do some significnce testing using Python statsmodels.
I have compiled two tests using OLS and weightstats.ttest_ind on the same data. My dataset contains one independent variable with values 0 and 1 and a continuous dependent variable. The number of 0 and 1 values is unequal which is why I used the option usevarstr = ‘unequal’ for the t-test. This yielded different outcomes between OLS and t-test. Running the t-test with usevarstr = ‘pooled’ however gave me the same results as OLS, except for the p-value. I do not understand why the p-values is so much higher in the t-test.
t-test with usevarstr='pooled': (4.864087195854719, 1.1864780944353952e-05, 50.0)
t-test with usevarstr='unequal': (4.8062218093574405, 1.7557614217538848e-05, 44.90172116268066)
Is there an option in statsmodels OLS that is equivalent to t-test with unequal distribution? And if not, can I rely on the results I am getting now although they assume equal distribution (as far as I understand it)?
Or maybe there is something esle going on that I am missing?