Suppose that are realisations of IID random variables with distribution and are realisations of IID random variables with distribution. Assume also that are independent for . We will assume that the population variance is the same for both populations, but that it is unknown.
The algorithm for testing
vs.
is as follows.
Calculate the sample means and , and the sample variances and .
Find the pooled sample variance,
Calculate the test statistic
Compare to the -distribution, using either a -value or critical region approach.
A baker wants to test whether his two apprentices, Jack and Jill, are baking loaves of bread of a consistent size. He takes a sample of ten loaves from Jack, and eight from Jill. The weights of the loaves (in grams) from the two samples are:
Jack: 502, 502, 495, 506, 492, 505, 504, 502, 490, 512
Jill: 495, 500, 495, 501, 494, 501, 505, 493
The data can also be downloaded in the file loaves. Is there evidence that the mean weight of a loaf baked by Jill is lower than the mean weight of a loaf baked by Jack?
Test, at the 5% level, the hypothesis
vs.
Let denote the weights of the loaves baked by Jack and let denote the weights of the loaves baked by Jill.
First calculate the two sample means. Using R (or by hand),
,
.
And
,
.
Since and , the pooled variance is
Since here , the test statistic is
To calculate the -value in R, we compare to the -distribution. Since ,
That is a -value of . We conclude that there is no evidence to reject at the 5% level, i.e. there is no evidence that Jill is baking smaller loaves than Jack.
To carry out the previous test using a critical value approach, we would look in tables for the value of at the 10% level (since we are doing a one-tailed test at the 5% level). This is 1.75. Since , we would not reject at the 5% level.