Hypothesis Testing
Test
Type
What are we testing?
𝐢𝐻𝐼 (πœ’ 2 )
Goodness of
Fit
𝐺𝑂𝐹
How well (good) does
the data provided “fit”
the suggested model?
𝐻0 : π‘šπ‘œπ‘‘π‘’π‘™ 𝑖𝑠 π‘Žπ‘π‘π‘Ÿπ‘œπ‘π‘Ÿπ‘–π‘Žπ‘‘π‘’
𝐻1 : π‘šπ‘œπ‘‘π‘’π‘™ 𝑖𝑠 π‘–π‘›π‘Žπ‘π‘π‘Ÿπ‘œπ‘π‘Ÿπ‘–π‘Žπ‘‘π‘’
𝐢𝐻𝐼 (πœ’ 2 )
Test for
Independence
2π‘Šπ΄π‘Œ
Are the two variables
given independent or
dependent?
𝐻0 : π‘£π‘Žπ‘Ÿπ‘–π‘Žπ‘π‘™π‘’π‘  π‘Žπ‘Ÿπ‘’ 𝑖𝑛𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑑
𝐻1 : π‘£π‘Žπ‘Ÿπ‘–π‘Žπ‘π‘™π‘’π‘  π‘Žπ‘Ÿπ‘’ 𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑑
𝑑
1 − π‘ π‘Žπ‘šπ‘π‘™π‘’
Assuming the data is
normally distributed
(continuous and
symmetrical), has the
mean changed (more,
less or different)?
𝐻0 : πœ‡ 𝑖𝑠 π‘Žπ‘  𝑔𝑖𝑣𝑒𝑛
𝐻1 : πœ‡ π‘šπ‘œπ‘Ÿπ‘’ π‘œπ‘Ÿ 𝑙𝑒𝑠𝑠 π‘‘β„Žπ‘Žπ‘› 𝑔𝑖𝑣𝑒𝑛
𝑑
2 − π‘ π‘Žπ‘šπ‘π‘™π‘’
Are the means from two
samples equal or
different?
Hypotheses
Example:
𝐻0 : πœ‡ = 61π‘šπ‘š
𝐻1 : πœ‡ > 61π‘šπ‘š
πœ‡1 = πœ‡2
πœ‡1 ≠ πœ‡2
𝐢𝐻𝐼 πœ’
2
𝐺𝑂𝐹
A newspaper vendor in Singapore is trying to predict how many copies of The Straits
Times they will sell. The vendor forms a model to predict the number of copies sold each
weekday. According to this model, they expect the same number of copies will be sold
each day. To test the model, they record the number of copies sold each weekday during
a particular week. This data is shown in the table.
π‘‡π‘œπ‘‘π‘Žπ‘™
460
A goodness of fit test at the 5% significance level is used on this data to determine
whether the vendor’s model is suitable. The critical value for the test is 9.49 and the
hypotheses are
𝐻0 ∢ π‘‡β„Žπ‘’ π‘‘π‘Žπ‘‘π‘Ž π‘ π‘Žπ‘‘π‘–π‘ π‘“π‘–π‘’π‘  π‘‘β„Žπ‘’ π‘šπ‘œπ‘‘π‘’π‘™.
𝐻1 ∢ π‘‡β„Žπ‘’ π‘‘π‘Žπ‘‘π‘Ž π‘‘π‘œπ‘’π‘  π‘›π‘œπ‘‘ π‘ π‘Žπ‘‘π‘–π‘ π‘“π‘¦ π‘‘β„Žπ‘’ π‘šπ‘œπ‘‘π‘’π‘™.
(a) Find an estimate for how many copies the vendor expects to sell each day.
Expected
(b)
Monday
Tuesday
Wednesday
92
92
92
Thursday
92
Friday
92
(i) Write down the degrees of freedom for this test. 5 − 1 = 4
(ii) Write down the conclusion to the test. Give a reason for your answer.
[1]
[5]
𝐢𝐻𝐼 πœ’
Expected
92
2
92
𝐺𝑂𝐹
92
92
92
Doing the Test:
1. Go to Statistics and Populate List 1 with the
observed values and List 2 with the expected
values.
2. Go to Test, Chi, GOF and change the degrees of
freedom (in this case to 4).
3. Click EXE to complete the test.
4. Make your conclusion.
(ii) Write down the conclusion to the test. Give a reason for your answer.
𝒑 = 𝟎. πŸŽπŸ•πŸ‘πŸ”
[5]
𝟎. πŸŽπŸ•πŸ‘πŸ” > 𝟎. πŸŽπŸ“ π’”π’Šπ’ˆ 𝒍𝒆𝒗𝒆𝒍
∴ π’Šπ’π’”π’–π’‡π’‡π’Šπ’„π’Šπ’†π’π’• π’†π’—π’Šπ’…π’†π’π’„π’† 𝒕𝒐 𝒓𝒆𝒋𝒆𝒄𝒕 𝒏𝒖𝒍𝒍 π’‰π’šπ’‘π’π’•π’‰π’†π’”π’Šπ’” 𝒂𝒏𝒅 𝒄𝒐𝒏𝒄𝒍𝒖𝒅𝒆
𝒕𝒉𝒂𝒕 𝒕𝒉𝒆 𝒅𝒂𝒕𝒂 π’”π’‚π’•π’Šπ’”π’‡π’Šπ’†π’” 𝒕𝒉𝒆 π’Žπ’π’…π’†π’
𝐢𝐻𝐼 πœ’ 2 2π‘Šπ΄π‘Œ
A 𝝌𝟐 test for independence was performed on the collected data at the 1 % significance
level. The critical value for the test is 13.277.
𝐻 : π‘£π‘Žπ‘Ÿπ‘–π‘Žπ‘π‘™π‘’π‘  π‘Žπ‘”π‘’ π‘Žπ‘›π‘‘ π‘π‘Ÿπ‘’π‘“π‘’π‘Ÿπ‘Ÿπ‘’π‘‘
0
(a) State the null and alternative hypotheses.
𝑑𝑒𝑣𝑖𝑐𝑒 π‘Žπ‘Ÿπ‘’ 𝑖𝑛𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑑
𝐻1 : π‘£π‘Žπ‘Ÿπ‘–π‘Žπ‘π‘™π‘’π‘  π‘Žπ‘”π‘’ π‘Žπ‘›π‘‘ π‘π‘Ÿπ‘’π‘“π‘’π‘Ÿπ‘Ÿπ‘’π‘‘
[1]
𝑑𝑒𝑣𝑖𝑐𝑒 π‘Žπ‘Ÿπ‘’ 𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑑
(b) Write down the number of degrees of freedom.
π‘Ÿπ‘œπ‘€π‘  − 1 × π‘π‘œπ‘™π‘’π‘šπ‘›π‘  − 1 = 2 × 2 = 4
(c)
(i) Write down the πœ’ 2 test statistic.
(ii) Write down the p-value.
(iii) State the conclusion for the test in context. Give a reason for your answer.
[1]
[5]
𝐢𝐻𝐼 πœ’ 2 2π‘Šπ΄π‘Œ
Doing the test:
1. In Statistics, go to TEST, CHI and then 2WAY. Your
screen should look like this:
2. When on observed, click F2 and DEL-ALL to clear
any matrices you have populated already.
3. Click EXE on Mat A and then enter the dimensions
of the table. In this case, 3 × 3.
4. Click EXE and then populate the numbers from the
table given.
5. Now, click EXIT twice to return to test page.
6. Finally, click EXE to do the test and make your
conclusions.
𝟐
(i) Write down the 𝝌𝟐 test statistic. 𝝌 = πŸπŸ‘. πŸ‘πŸπŸ”
(ii) Write down the p-value. 𝒑 = 𝟎. πŸŽπŸŽπŸŽπŸπŸŽπŸ—
(iii) State the conclusion for the test in context. Give a reason for your answer.
𝒑 = 𝟎. πŸŽπŸŽπŸŽπŸπŸŽπŸ— < 𝟎. 𝟎𝟏 π’”π’Šπ’ˆ 𝒍𝒆𝒗𝒆𝒍
∴ π’”π’–π’‡π’‡π’Šπ’„π’Šπ’†π’π’• π’†π’—π’Šπ’…π’†π’π’„π’† 𝒕𝒐 𝒓𝒆𝒋𝒆𝒄𝒕 𝒏𝒖𝒍𝒍 π’‰π’šπ’‘π’π’•π’‰π’†π’”π’Šπ’” 𝒂𝒏𝒅 𝒄𝒐𝒏𝒄𝒍𝒖𝒅𝒆 𝒕𝒉𝒆 π’—π’‚π’“π’Šπ’‚π’ƒπ’π’†π’” 𝒂𝒓𝒆 𝒅𝒆𝒑𝒆𝒏𝒅𝒆𝒏𝒕
𝑑 (1 − π‘ π‘Žπ‘šπ‘π‘™π‘’)
The heights of trees in a certain forest are known to be normally distributed with mean
23.6m. Zhao measured the heights of ten trees in a different forest, recording the
following results (in metres):
13.6, 22.5, 18.0, 21.3, 28.7, 31.6, 12.8, 22.5, 18.9, 23.1
Assuming that the heights of trees in this forest are also normally distributed, use a t test
to determine whether there is evidence, at the 10% significance level, that the trees in this
forest are shorter on average.
𝐻0 : πœ‡ = 23.6π‘š
Doing the test:
𝐻1 : πœ‡ < 23.6π‘š
1. In Statistics an populate List 1 with the sample.
2. Go to Test, t, 1-sample (because we are given 1 list).
3. Click F1 to make sure you are on List mode.
4. Set πœ‡0 = 23.6 (given in the question).
5. Change the inequality to < as we are testing if the
heights are shorter.
6. Finally, scroll down and click EXE to do the test and
make your conclusions.
𝒑 = 𝟎. πŸπŸπŸ“πŸ
𝟎. πŸπŸπŸ“πŸ > 𝟎. 𝟏 π’”π’Šπ’ˆ 𝒍𝒆𝒗𝒆𝒍
∴ π’Šπ’π’”π’–π’‡π’‡π’Šπ’„π’Šπ’†π’π’• π’†π’—π’Šπ’…π’†π’π’„π’† 𝒕𝒐 𝒓𝒆𝒋𝒆𝒄𝒕 𝒏𝒖𝒍𝒍 π’‰π’šπ’‘π’π’•π’‰π’†π’”π’Šπ’” 𝒂𝒏𝒅 𝒄𝒐𝒏𝒄𝒍𝒖𝒅𝒆 𝒕𝒉𝒂𝒕 𝒕𝒉𝒆 π’Žπ’†π’‚π’ π’Šπ’” πŸπŸ‘. πŸ”
𝑑 (2 − π‘ π‘Žπ‘šπ‘π‘™π‘’)
At Springfield University, the weights, in kg, of 10 chinchilla rabbits and 10 sable rabbits were
recorded. The aim was to find out whether chinchilla rabbits are generally heavier than sable
rabbits. The results obtained are summarized in the following table.
A t-test is to be performed at the 5% significance level.
𝐻 :πœ‡
=πœ‡
0 π‘β„Žπ‘–π‘›π‘β„Žπ‘–π‘™π‘™π‘Ž
π‘ π‘Žπ‘π‘™π‘’
(a) Write down the null and alternative hypotheses.
𝐻0 : πœ‡π‘β„Žπ‘–π‘›π‘β„Žπ‘–π‘™π‘™π‘Ž > πœ‡π‘ π‘Žπ‘π‘™π‘’
(b) Find the p-value for this test. 𝒑 = 𝟎. πŸŽπŸ’πŸπŸ“πŸ•
(c) Write down the conclusion to the test. Give a reason for your answer.
Doing the test:
1. In Statistics an populate List 1 with the sample 1 and List 2
with sample 2.
2. Go to Test, t, 2-sample (because we are given 2 lists).
3. Change the inequality to > as we are testing if the chinchilla
weights (List 1) are heavier.
4. Finally, scroll down and click EXE to do the test and make
your conclusions.
𝒑 = 𝟎. πŸŽπŸ’πŸπŸ“πŸ• < 𝟎. πŸŽπŸ“ π’”π’Šπ’ˆ 𝒍𝒆𝒗𝒆𝒍
∴ π’”π’–π’‡π’‡π’Šπ’„π’Šπ’†π’π’• π’†π’—π’Šπ’…π’†π’π’„π’† 𝒕𝒐 𝒓𝒆𝒋𝒆𝒄𝒕 𝒏𝒖𝒍𝒍 π’‰π’šπ’‘π’π’•π’‰π’†π’”π’Šπ’” 𝒂𝒏𝒅 𝒄𝒐𝒏𝒄𝒍𝒖𝒅𝒆 𝒕𝒉𝒂𝒕
π’„π’‰π’Šπ’π’„π’‰π’Šπ’π’π’‚ π’“π’‚π’ƒπ’ƒπ’Šπ’•π’” 𝒂𝒓𝒆 π’ˆπ’†π’π’†π’“π’‚π’π’π’š π’‰π’†π’‚π’—π’Šπ’†π’“ 𝒕𝒉𝒂𝒏 𝒔𝒂𝒃𝒍𝒆 π’“π’‚π’ƒπ’ƒπ’Šπ’•π’”