# What is the “under the null hypothesis” and how do I calculate it for a t-test?

I am having trouble with a definition. I simply don't get what is asked.

• Give the significance level --> this is 0.05
• Give the test statistic and its distribution under the null hypothesis

Main question:

Michael and Bernard have evening shifts at a supermarket. Michael has complained to the manager that he works, on average, much more than Bernard. The manager claims that on average they both work the same amount of time. After a short discussion between the manager and Michael, the manager randomly selected 50 evenings when Michael worked, and 50 evenings when Bernard worked (not necessarily the same evenings as each other).

Now, I am using R Studio. I can get these datasets and load them in. I've decided to use the t test, because n > 30 and I don't know the standard deviation. That's something I get.

The test statistic should be a t-value / t-score (am I correct?). I can get this in R Studio via: t.test(Michael, Bernard) which gives me the value of t = 1.548 and a degrees of freedom = 91.778...

Now, they ask for its distribution under the null hypothesis, but I just don't get what they mean with this. What I think and what I did, is to check the critical t-values table... but there, I can't find the degrees of freedom of 91.778. So clearly, this must be wrong...

Beside that, I don't get how it's 91.778. I would expect df = n-1 or df = (n1 + n2) - 2 (because it's two samples), so at least 98 would have been the df, but clearly it isn't.

What am I doing wrong in my thinkings? And what is being asked with "under the null distribution"? What do they want as an answer? A score? A percentage? Can someone explain this to me please?

Edit: the data set is asked, of course I can provide them:

Michael:

[1] 4.32 3.82 4.11 4.75 3.58 3.93 3.50 4.69 4.28 3.75 3.58 4.96 3.72 4.97 3.57 4.06
[17] 3.14 4.04 3.81 5.07 3.81 4.38 3.72 2.56 4.46 3.39 3.43 3.36 3.88 3.31 4.11 4.34
[33] 4.03 4.00 4.03 3.66 4.62 4.46 3.97 3.94 3.56 4.33 3.03 3.25 3.96 3.97 2.68 4.66
[49] 4.78 3.75


Bernard:

 [1] 3.06 4.78 4.12 4.19 4.34 5.04 3.96 4.25 3.54 3.07 3.17 3.17 3.25 4.19 3.75 3.65
[17] 2.25 3.36 2.53 3.44 2.86 4.56 2.44 2.25 3.71 3.31 3.38 2.19 2.92 3.36 2.88 3.91
[33] 4.39 4.41 4.44 3.84 4.00 4.75 4.21 4.31 3.78 4.59 4.97 3.69 4.31 3.53 4.75 4.03
[49] 4.16 3.92

• The null hypothesis is simply the result you would like to reject. For a simple single parameter it could be a single point or one-sided or two-sided intervals. – Michael Chernick Dec 7 '16 at 19:53
• @MichaelChernick: still don't get what is meant with that. – Siyah Dec 7 '16 at 20:00
• @MichaelChernick, please be cautious in how you address [self-study] questions. Our policy is to give hints only (you can read our policies here). – gung Dec 7 '16 at 20:22
• If you look at ?t.test in R, you see that the standard of the t.test function is to assume unequal variances and the Welch modification to the degrees of freedom is used. Try with t.test(...., var.equal = T) – Repmat Dec 7 '16 at 20:27
• @gung I know the policy. When the OP id close to getting it I like to get him a little closer. Maybe I gave a strong hink. But I don't think I completely gave away the right answer. – Michael Chernick Dec 8 '16 at 0:44

Wow, there's lots to deal with here. I'm assuming this is homework, so my first advice is that you catch up on the expected reading!

Second, the "significance level" has a different meaning depending on whether you are working within the dichotomous hypothesis testing framework of Neyman or the significance testing framework of Fisher. In the former case the significance level is an unfortunate phrase indicating the alpha level or 'size' of the test, and it might be 0.05 as you indicate, but only if that level is explicitly decided prior to the data being analysed. In the latter case the significance level refers to the observed significance level, the p-value. (That distinction is not always observed by introductory stats texts and may be unknown to some instructors.)

Next, if you are doing a Student's t-test then the test statistic is t. I expect that the question would be answered by an explanation of the meaning of the t statistic and how it is calculated for the particular experiment.

Next, the t-test that you have calculated using R is a Welch's variant. It relaxes the assumption of the original Student's t-test that the variances of the populations are equal. The way it is calculated leads to fractional degrees of freedom. For a conventional Student's t-test your degrees of freedom would be n1-1 + n2-1.

Finally, the distribution that you have been asked for is the distribution of t under the assumption that the parameter of interest (mean difference) is equal to the null hypothesised value (usually zero, but it can be any value desired). The tabulated critical values of t that you consulted will not suffice.

• I think I understand now. I don't need to use the Welch's variant. I just need to use a two sample form and when I do that, the degree of freedom changes as expected... what I still don't get though, is what you mean with your last paragraph. "It can be any value desired?". It sounds like I can just write whatever, but I don't get what is asked and how I should think about it... – Siyah Dec 7 '16 at 21:11
• You can decide what to test for. Usually, the null hypothesis will be that there is no effect (but you suspect there is one and test for a non-null value). In your example no effect means no difference between the two. – David Ernst Dec 8 '16 at 12:32

What is asked here is to actually compare the average time that two people work.

So the null hypothesis is something you want to check against something else. Here you want to check if the average time that Michael works is different (either has larger or smaller value) than the average time that Bernard works. So, the null hypothesis is H0: the average working hours for Michael are equal to the average working hours of Bernard. You test this hypothesis against the alternative H1: their working hours differ. To test such a hypothesis, you perform a t-test (for comparing two means). This test though assumes that your data follow Normal distribution. You compare the t-statistic value that you found with the theoretical values from the t-table to find the significance of your result.

Check this link to understand why you use the t-table and what are the degrees of freedom and how you get the p-value: https://onlinecourses.science.psu.edu/stat500/node/50

• Please be cautious in how you address [self-study] questions. Our policy is to give hints only (you can read our policies here). – gung Dec 7 '16 at 20:36
• Why does this test assume following normal distribution? Where does that come from; how do you know? I thought that was the case for z-tests... – Siyah Dec 7 '16 at 21:13

So the issue with the decimal degrees of freedom is sorted out. When you use the basic version of the t-test, you get integer numbers that you can also find in tables. Let's put that aside.

When you have to ask "what is meant by 'what is the distribution under H0?'", it shows us that you have not yet understood the basic principle of statistical testing. Once you understand this principle, it applies not only to t-tests but in the exact same way also to z-tests, F-tests, chi2-tests etc. Doing statistical tests without a deep understanding of what this means however comes down to following cooking recipes blindly without knowing what any of it means.

To nudge you in the right direction: You are asked if H0 can be rejected in light of the data, so you have to compare some number that is based on the data with some number that is based on H0. You have identified all the necessary components for this comparison, which do you think is which? Think about this and reread the relevant section of your textbook keeping it in mind. (Any textbook must have a clear explanation of this concept, but if you can't find it, we can always give you a link to another text.)