Hypothesis Testing in Statistics Guide
Hypothesis Testing in Statistics Guide
15 Hypothesis testing
ESSENTIAL UNDERSTANDINGS
n Statistics uses the theory of probability to estimate parameters, discover empirical laws, test
hypotheses and predict the occurrence of events.
n Both statistics and probability provide important representations which enable us to make
predictions, valid comparisons and informed decisions.
n The fields of statistics and probability have power and limitations and should be applied with care and
critically questioned, in detail, to differentiate between the theoretical and the empirical/observed.
■■ Figure 15.1 How sure can we be of the assumptions we make about populations based on data samples?
f f
30 30
20 20
10 10
300
250
200
150
100
50
0
0 1 2 3 4 5 6 7 8 9 10
number of sixes
Applications and interpretation: Hypothesis testing 371
CONCEPTS
The following key concepts will be addressed in this chapter:
n Organizing, representing, analysing and interpreting data, and utilizing different
statistical tools facilitates prediction and drawing of conclusions.
n Different statistical techniques require justification and the identification of their
limitations and validity.
n Approximation in data can approach the truth but may not always achieve it.
n Correlation and regression are powerful tools for identifying patterns.
PRIOR KNOWLEDGE
Before starting this chapter, you should already be able to complete the following:
1 There are 263 students in a year group. The probability of a student being absent is 0.07.
Find the expected number of absent students.
2 Given that X ∼ B(30, 0.23) find P(12 X 18).
3 Given that X ~ N(25, 4.82) find P(X 27).
4 a Find the Pearson’s product-moment correlation coefficient for this data:
32 51 87 22 45 57 45 73
12 18 15 11 15 17 12 19
b Interpret the value found in part a, given that the critical value of the correlation
coefficient is 0.549.
In statistics, we use sample data to make inferences about a population. This always
involves some degree of uncertainty, for example, the mean of a sample will not be,
in general, exactly the same as the mean of the population. We can use probability to
decide whether a value obtained from a sample is significantly different from what we
expect.
Hypothesis testing is used to determine whether something about a population has
changed, or whether two populations have significantly different characteristics.
Different types of test are appropriate in different situations and it is important to
understand the advantages and limitations of each test. Hypothesis tests are commonly
used in a range of subjects, including Biology, Geography, Psychology and Exercise and
Health Science.
Starter Activity
Each of the histograms in Figure 15.1 represent a sample from a different population. What
can you suggest about the distribution of each population? How confident are you in your
statement?
One common statistical technique for answering such questions is hypothesis testing.
This procedure starts with a default position, called the null hypothesis, and determines
whether sample data provides sufficient evidence against it, and in favour of an
alternative hypothesis.
In examples a and b on the previous page, the alternative hypotheses specified the
anticipated direction of change: whether the temperature has increased, or whether
the correlation is negative. In some situations, you may have a reason to believe that
the mean value, for example, has changed, but you might not have any indication in
which direction it has changed. In this case you need to use ≠, instead of or , in the
alternative hypothesis.
In a hypothesis test, you start with a default position (the null hypothesis) and ask
whether there is significant evidence against it. Such evidence is found if, assuming
the null hypothesis is true, it would be very unlikely to observe the sample data you
collected. What ‘very unlikely’ means is a matter of judgement. It may be different in
different contexts and is given by the significance level of the test.
When conducting a hypothesis test, you need to calculate the probability of obtaining
the observed sample value, or a more extreme value, assuming the null hypothesis
is true.
374 15 Applications and interpretation: Hypothesis testing
A Accept H0. There is insufficient evidence that the mean has changed.
B Do not reject H0. The mean daily temperature is still 23 °C.
C Do not reject H0. There is sufficient evidence that the mean height of 12-year-olds is
135 cm.
D Reject H0. There is no correlation between height and weight of puppies.
E Reject H0. The mean running time has decreased.
15A Chi-squared tests 375
The exact details of calculating the p-value depend on the type of test you are
conducting. You will learn about several different types of test in the following sections.
CONCEPTS – REPRESENTATION
The sample is just a snapshot of the whole population. If it has been collected in a
sensible way, we hope it will be a representative sample. However, it is rarely of interest
in its own right. Most mathematical statistics is about using information from a sample to
infer properties of the population. Hypothesis testing is one of the most common ways of
doing this.
a given distribution. The null hypothesis is that the data comes from the specified
distribution. The χ 2 statistic measures how far the observed data values are from what
would be expected if the null hypothesis were true. You can use your GDC to calculate
the χ statistic and the corresponding p-value from observed and expected frequencies.
2
You can then compare the χ statistic to the critical value, or the p-value to the
2
The critical value depends on the significance level and the number of groups in the
table.
lthough in the SL course you will only encounter situations where the number
A
of degrees of freedom is n − 1, this number can in fact change depending on the
number of parameters that have been estimated from the data. You will learn more
about this if you are studying Mathematics: applications and interpretation HL.
376 15 Applications and interpretation: Hypothesis testing
Language Frequency
Spanish 26
German 16
Russian 18
2
Igor conducts a χ test at the 5% significance level.
a State the null and alternative hypotheses.
d The critical value for this test is 5.991. What should Igor conclude?
Spanish 26 1 × 60 = 20
The expected frequencies are calculated 3
assuming H0 is true, so the proportions 1 × 60 = 15
are the same as in Igor’s year German 16
4
5 × 60 = 25
Russian 18
12
Use your GDC to find the critical value. You need From GDC,
to enter the observed and expected χ 2 = 3.8267, p = 0.1476
frequencies (into two different lists), and
the number of degrees of freedom
15A Chi-squared tests 377
2
Compare the χ value to the critical value
2
A large χ value provides evidence d 3.83 5.991, so there is insufficient evidence to reject H0.
against H0
There is insufficient evidence, at the 5% significance level,
Interpret the conclusion in context that the choices in the year below come from a different
distribution.
Sometimes you need to calculate probabilities before you can find expected frequencies.
You do this by using the distribution specified in the null hypothesis.
TOK Links
What type of error rate is acceptable to you in decisions you make? For example, when
choosing which subjects to study, which people to be friends with, or which clothes to
buy, what kind of mistakes do you make and how often do you make them? Are you ever
completely certain that you are making the right decision? What would life be like if you
could never make ‘mistakes’?
378 15 Applications and interpretation: Hypothesis testing
p-value.
The number of degrees of freedom depends on the size of the contingency table.
d Julio looks up a list of critical values for his test and finds that the appropriate critical value is 9.21. What should Julio
conclude from the test?
15A Chi-squared tests 379
The null hypothesis is that the two a H0: Age and favourite sport are independent.
variables are independent
H1: Age and favourite sport are not independent.
v = (m − 1)(n − 1) b v = (3 − 1)(2 − 1) = 2
Enter the observed frequency into a matrix c Expected frequencies:
The GDC will record the expected Adults Children
frequencies in a different matrix Football 11.6 19.4
Basketball 8.63 14.4
Baseball 9.75 16.3
2
From GDC, χ = 3.93
2
Compare the χ value to the critical value. You
2 d 3.93 9.21, so insufficient evidence to reject H0.
need a large χ value in order to reject H0
There is insufficient evidence that age and favourite
State the conclusion in context
sport are not independent.
Tip
You are the Researcher
If a conclusion
There are some situations when the χ test needs to be adapted. For example, the
2
suggests things are not
independent, then it above procedure is not valid if any of the expected frequencies are smaller than
implies a relationship five, or if the number of degrees of freedom is 1 (so for a 2 × 2 table). One possible
alternative to the χ test that you might like to investigate is Fisher’s exact test.
2
and so they can also be
called dependent.
Exercise 15A
For questions 1 to 3, use the method demonstrated in Worked Example 15.1 and 15.2. For each situation, write down
suitable hypotheses and state whether the test is one-tailed or two-tailed.
1 a The mean temperature in Perth in 1980 was 23.4 °C. Sonya wants to test whether the average temperature in
2018 was higher.
b Paulo’s mean time for a 2 km run was 8.3 minutes. After following a new training regime, he wants to test
whether his mean time has decreased.
2 a A bottle claims to contain 300 ml of water on average. Tamara wants to test whether the mean amount of water
in a bottle is different.
b The mean height of adult residents of Nairobi is 163 cm. Amandla wants to test whether the mean height of
residents of Boston is different.
380 15 Applications and interpretation: Hypothesis testing
3 a Leila is investigating whether there is a negative correlation between maximum daily temperature and the
number of people at a seaside café.
b Bashir is investigating whether there is any correlation between daily rainfall and minimum daily temperature.
For questions 4 to 6, use the method demonstrated in Worked Example 15.3 to state the conclusion of the hypothesis test.
4 a H0: μ = 13.4, H1: μ > 13.4, 5% significance level; p-value = 0.0638
b H0: μ = 26, H1: μ > 26, 5% significance level; p-value = 0.105
5 a H0: μ = 2.6, H1: μ ≠ 2.6, 10% significance level; p-value = 0.0723
b H0: μ = 8.5, H1: μ ≠ 8.5, 10% significance level; p-value = 0.103
6 a H0: The data comes from the distribution N(12, 3.42)
H1: The data does not come from the distribution N(12, 3.42)
5% significance level, p-value = 0.0492
b H0: The data comes from the distribution N(53, 82)
H1: The data does not come from the distribution N(53, 82)
5% significance level, p-value = 0.102
In questions 7 to 9, you are given expected probabilities and observed frequencies. The null hypothesis is that the
observed data comes from the same distribution as the expected values. Use the method from Worked Example 15.4 to
2
i calculate the expected frequencies and the χ value
ii state the number of degrees of freedom
iii find the p-value and state the conclusion of the test at 5% significance level.
7 a
Data value Red Blue Yellow
1 1 1
Expected probability
4 2 4
Observed frequency 34 51 15
8 a
Data value 1 2 3 4 5
Expected probability 0.2 0.2 0.2 0.2 0.2
Observed frequency 12 16 8 10 4
b
Data value 0 2 4 6
Expected probability 0.25 0.25 0.25 0.25
Observed frequency 6 18 13 23
9 a
Data value French Spanish English Mandarin
1 1 1 13
Expected probability
3 4 5 60
Observed frequency 52 51 30 67
In questions 10 to 12, you are given the null hypothesis, observed frequencies and the critical value for the goodness of
fit test. Using the method demonstrated in Worked Example 15.5, conduct the test and state the conclusion.
10 a H0: The data comes from the distribution B(4, 0.5)
Critical value = 9.49
Data value 0 1 2 3 4
Observed frequency 10 65 68 43 14
b H0: The data comes from the distribution B(5, 0.6)
Critical value = 12.8
Data value 0 1 2 3 4 5
Observed frequency 7 28 103 188 132 42
11 a H0: The data comes from the distribution B(10, 0.77)
Critical value = 9.24
Data value 5 6 7 8 9 10
Observed frequency 7 16 28 34 12 3
b H0: The data comes from the distribution B(20, 0.08)
Critical value = 7.78
Data value 0 1 2 3 4
Observed frequency 19 35 22 15 9
12 a H0: The data comes from the distribution N(5.5, 22)
Critical value = 7.78
Data value 2 2 to 4 4 to 6 6 to 8 >8
Observed frequency 7 21 44 17 11
b H0: The data comes from the distribution N(36, 112)
Critical value = 9.24
Data value 20 20–30 30–40 40–50 50–60 > 60
Observed frequency 25 92 140 112 29 2
In questions 13 to 15, you are given a contingency table of observed values of two variables and the critical value
2
for a χ test. Use the method demonstrated in Worked Example 15.6 to test whether the two variables are independent.
2
State the χ value and the conclusion of each test.
13 a b
12 15 21 63 81 35
22 18 12 27 32 62
Critical value = 9.21 Critical value = 7.38
14 a 8 12 16 b 18 13 8
9 15 21 13 16 21
13 14 22 8 18 22
Critical value = 7.78 Critical value = 9.49
382 15 Applications and interpretation: Hypothesis testing
15 a 62 37 81 b 13 11 11
88 53 30 12 8 3
26 15 32 21 16 9
81 73 55 13 13 13
Critical value = 12.6 Critical value = 10.6
16 Ruby wants to test whether students’ food preferences depend on their age. She conducts a survey in the school
canteen, recording which option each student chooses.
Veggie burger Fish fingers Peperoni pizza
Junior school 18 26 51
Senior school 53 38 47
2
Conduct a suitable χ test at the 5% significance level, stating your hypotheses and conclusion clearly.
17 A zoologist investigates whether different types of insect are more common in different locations. She collects a
random sample of insects from a meadow and a forest and counts the number of ants, bees and flies.
Ants Bees Flies
Meadow 26 15 21
Forest 32 6 18
Use a χ2 test with a 10% significance level to test whether the type of insect found depends on the location.
18 A theory predicts that three different types of flower should appear in the ratio 1 : 2 : 3. A sample of 60 flowers
2
contains 14 flowers of type A, 18 flowers of type B and 28 flowers of type C. A χ goodness of fit test is used
to test the theory at the 10% significance level.
a Calculate the expected frequencies and state the number of degrees of freedom.
2
b Find the χ value.
c The critical value is 4.605. State the conclusion of the test.
19 Zhao thinks that students at her large college are equally likely to study any of the four mathematics courses.
She asks a random sample of 80 students and obtains the following results:
Analysis and Analysis and Applications and Applications and
Course
approaches HL approaches SL interpretation HL interpretation SL
Number of students 18 21 8 33
2
Zhao conducts a χ test using a 5% significance level.
a State the null and alternative hypotheses.
b Write down the expected frequencies and the number of degrees of freedom.
c Find the p-value for the test and hence state the conclusion.
20 The table shows information about the mode of transport students use to get to school in four different cities. Use
2
a χ test to find out whether there is evidence, at the 5% significance level, that there is a relationship between the
mode of transport and the city.
Amsterdam Athens Houston Johannesburg
Car 12 25 48 24
Bus 18 33 12 18
Bicycle 46 12 7 53
Walk 38 8 3 21
15A Chi-squared tests 383
Outcome 1 2 3 4 5 6
Frequency 26 12 16 28 14 24
Is there evidence, at the 2% significance level, that the dice is not fair?
22 Rajesh is practising tennis serves. He takes three serves at a time and records the number of successful serves.
He believes that this number can be modelled by the binomial distribution B(3, 0.7).
Number of successful
0 1 2 3
serves out of three
Frequency 7 28 95 70
2
a State the hypotheses for a χ goodness of fit test.
b Find the expected frequencies and write down the number of degrees of freedom.
2
c Calculate the χ value.
d The critical value for the test is 6.25. State the conclusion of the test.
23 Michelle tosses six coins simultaneously and records the number of tails. She repeats this 600 times. The results
are shown in the table.
Number of tails 0 1 2 3 4 5 6
Frequency 9 62 120 178 152 67 12
a State the distribution of the number of tails for an unbiased coin.
b Hence work out the expected frequencies for Michelle’s experiment.
c Test at the 5% significance level whether there is evidence that the coins are biased.
24 Four friends are guessing answers to maths questions. They think that they each have the probability of 0.5 of
guessing the correct answer to any question, independently of each other.
a Let X be the number of correct answers to a single question. Accepting the assumptions above are correct, state
the distribution of X.
In order to test whether their assumptions are correct, the friends guess answers to 100 questions and record the
number of correct answers to each question.
Number of correct answers 0 1 2 3 4
Frequency 12 13 45 22 8
b State appropriate hypotheses for a χ2 goodness of fit test.
c State the number of degrees of freedom.
d Conduct the test at the 2% significance level and state your conclusion.
25 An athlete believes that her long jump distances follow a normal distribution with mean 5.8 m and standard
deviation 0.8 m.
a Assuming her belief is correct, copy the table below and fill in the missing probabilities:
26 A train company claims that times for a particular journey are distributed normally with mean 23 minutes and
standard deviation 2.6 minutes. Sumaya takes this train to school and wants to test the company’s claim. She
2
decides to conduct a χ test and records the durations of 50 randomly selected journeys:
Time (min) < 21.5 21.5–22.5 22.5–23.5 23.5–24.5 > 24.5
Frequency 3 8 14 17 8
a Find the expected frequencies.
b Write down the number of degrees of freedom.
2
c Calculate the χ value.
d The critical value for Sumaya’s test is 9.49. State the conclusion in context.
27 A teacher suggests that exam grades at their college can be modelled by the following distribution:
g (11 − g )
P(G = g ) = for g = 3, 4, 5, 6, 7
140
A random sample of 40 students had the following grades:
Grade 3 4 5 6 7
Frequency 2 10 9 12 7
Test, using a 10% significance level, whether the teacher’s model is appropriate for these data.
28 Katya wants to find out whether diet choices are dependent on age. She collects data from 200 pupils at her school
and records it in the contingency table:
Vegetarian Vegan Eats meat
11–13 12 32 21
14–15 22 16 30
16–19 26 18 23
2
a Conduct a χ test for independence, using a 1% significance level. State your conclusion in context.
In order to get a better understanding of the data, Katya decides to split the 16–19 age group in two. The new data
table is:
Vegetarian Vegan Eats meat
11–13 12 32 21
14–15 22 16 30
16–17 13 12 10
18–19 13 6 13
b Repeat the test, stating the new conclusion clearly.
29 A teacher asked a group of 80 students for their preference out of three science subjects. The table shows the
fraction of students in each group.
Boys Girls
3 1
Biology
20 5
1 3
Chemistry
10 20
1 3
Physics
4 20
a Test, using a 10% significance level, whether favourite science is independent of gender.
b The teacher decides to check her results by using a larger sample. She asks a group of 240 students and finds
that the fractions in each group are the same. Repeat the test and state the new conclusion.