0
$\begingroup$

I am doing a two-sample student t-test ($\alpha = 0.05$) with the null hypothesis being the mean of group 1 is $\leq$ mean of group 2, and the alternate being, mean of group 1 > mean of group 2.

After running the code that does the test in python (stats.ttest) i get a test statistic of -2.83 and a p value of 0.00465. I understand that this p-value is for a two tail test thus i was wondering how to turn this into a 1-tail p-value (do i simple divide by 2 or do i do 1-(p/2)) and whether or not i reject the Null in this case?

Thank You!

$\endgroup$

1 Answer 1

0
$\begingroup$

Im not sure, what stats.ttest is calculating. But if the sample mean of group 1 ≤ the sample mean of group 2, your $p$-value would be $1-p/2$ (I would think this is what it calculates). The null hypothesis couldn't be rejected, since it looks the other way around (note that this can't be claimed any more - only if you would have chosen a two-sided $t$-test).

If the sample mean of group 1 > the sample mean of group 2, you could divide it by 2 and the null hypothesis could be rejected.

Please note that you should always fix your hypothesis (and whether you want to use a one-sided and in which direction or two-sided test) before the experiment and not after looking at the data.

$\endgroup$
5
  • $\begingroup$ What do you mean by you're not sure what stats.ttest is calculating? In python you input your group 1 and group 2 sampled data into stats.ttest() and it gives an output which is the Student t-test t-stat and the 2-tail p-value. My confusion was how to transform this 2-tail p-value into a 1-tail p-value (since my hypothesis is one-sided) and then make a conclusion as to whether or not to reject the null. $\endgroup$
    – HelloThere
    Apr 28, 2019 at 14:52
  • $\begingroup$ Could you show me a reference to stats.ttest? $\endgroup$
    – Kornel
    Apr 28, 2019 at 15:14
  • $\begingroup$ Because it's not always clear what group 1 and what group 2 means. Also if you could tell me the sample means of your data, I would be sure what python is doing and could answer your question. $\endgroup$
    – Kornel
    Apr 28, 2019 at 15:17
  • $\begingroup$ Reference: docs.scipy.org/doc/scipy/reference/generated/… My group 1 sample mean = 0.368622 My Group 2 sample mean = 1.422089 $\endgroup$
    – HelloThere
    Apr 30, 2019 at 4:37
  • $\begingroup$ So there is no evidence that group mean 1 > group mean 2 (it seems more the other way around!), you have a p-value of 0.9976 and you can't reject the null hypothesis. $\endgroup$
    – Kornel
    Apr 30, 2019 at 5:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.