# two sample hypothesis testing

I am comparing the means of male and female blood sugar levels to see if males have lower blood sugar levels than females. My hypothesis is as follows:

H0 : µf - µm = 0 Ha : µf - µm >0

on a 5% significance level, H0 should be rejected, since p-value (Prob>|t|) = 0.001/2 < 0.05.

Is this correct? Because when I look at the output and compare the means the male mean is higher than the female mean.

• You didn't specify a one-sided test in your code. So the p-values refer to male blood glucose levels not equal to female blood glucose levels. – Michael Chernick Sep 30 '17 at 20:38
• While containing potentially useful information, neither of the answers directly address the central point (that Michael clearly mentions in his comment) -- OP wants a one tailed test but has done a two-tailed test. This is why the p-value is low even though the samples are consistent with the OP's null. Without that particular piece of information I don't think the present answers are really addressing the question. – Glen_b Oct 1 '17 at 1:29
• @Glen_b Yes this is a two-tailed test, that's why the p-value I used is divided by 2. Or do I understand this wrong? – user179028 Oct 1 '17 at 8:07
• No, your stated $H_a$ is clearly specifying one tail. – Glen_b Oct 1 '17 at 8:16

Your first group is Female. Your second group is Male. t-test is checking if Female - Male difference is significant (i.e., Diff(1-2)). That's why you are getting negative t-test values. If you can, change ORDER option or coding of your grouping variable.

This group of males has, on average, a higher level than this group of females. Any conclusion that "males" have a higher level than "females" is unsafe.

What population is your sample drawn from? How confident are you that the drawn is random? Are both distributions more or less normal? Age is correlated with blood glucose levels - do you have ages so you can control for that?

Even setting aside these considerations, a pair of histograms would help. Many e.g. a long tail of males has a lower level than any females in the sample - the larger standard deviation for males should push you to examine the distribution.

OK, maybe this is a homework question, but if you are going to use these methods you need to step back and look at the wider context.