You are on page 1of 60

HYPOTHESIS

TESTING
Data and Variable
 DATA:
 the answers to questions or measurements
from the experiment

 VARIABLE :
 measurement which varies between subjects
e.g. height or gender
Data and variables
One variable per
column

One row
per subject
Data Variables

Categorical:
Scale
appear as categories
Measurements/ Numerical/ Tick boxes on questionnaires
count data
Variables

Scale Categorical

Continuous Nominal:
Discrete: Ordinal:
Measurements
Counts/ integers no meaningful
obvious order
takes any value order
What data types relate to following questions?
 Q1: What is your favourite subject? Nominal

Maths English Science Art French

 Q2: Gender: Male Female Binary/ Nominal

 Q3: I consider myself to be good at mathematics:


Strongly Disagree Not Sure Agree Strongly
Ordinal
Disagree Agree

 Q4: Score in a recent mock GCSE maths exam:


Score between 0% and 100% Scale
HYPOTHESIS
• The statement or an assumption
about relationships between
variables.
• A tentative explanation for
certain behaviors, phenomenon
or events that have occurred or
will occur.
Examples
• Bankers assumed high-income
earners are more profitable than
low-income earners.
• Old clients were more likely to
diminish CD balances by large
amounts compared to younger
clients.
 Is a standard procedure for testing a
claim about a property of a
population.
 An objective method of making
decisions or inferences from sample
data (evidence)

 Sample data used to choose between


two choices i.e. hypotheses or
statements about a population

 We typically do this by comparing


what we have observed to what we
expected if one of the statements
(Null Hypothesis) was true
Key Concept
The role of the following should be understood:
 null hypothesis
 alternative hypothesis
 test statistic
 critical region
 significance level
 critical value
 P-value
 Type I and II error

Slide 10
 Always two hypotheses:
HA: Research (Alternative) Hypothesis
 What we aim to gather evidence of
 Typically that there is a
difference/effect/relationship etc.
H0: Null Hypothesis
 What we assume is true to begin with
 Typically that there is no
difference/effect/relationship etc.
TYPES HYPOTHESIS
• Null Hypothesis (H0)
• Alternative Hypothesis (Ha or H1)
H0: µ = µ0 Ha: µ ≠ µ0

H0: µ ≤ µ0 Ha: µ < µ0

H0: µ ≥ µ0 Ha: µ > µ0


Null Hypothesis: H0
 The null hypothesis (denoted by H0) is
a statement that the value of a
population parameter (such as
proportion, mean, or standard
deviation) is equal to some claimed
value.
 We test the null hypothesis directly.
 Either reject H0 or fail to reject H0.

Slide 13
Alternative Hypothesis: H1
 The alternative hypothesis
(denoted by H1 or Ha or HA) is the
statement that the parameter has
a value that somehow differs from
the null hypothesis.
 The symbolic form of the
alternative hypothesis must use
one of these symbols: , <, >.
Slide 14
Discussion

• How could you understand


what hypothesis testing is and
why they need to use it?

Slide 15
“The Court Case”

• Members of a jury have to decide whether a


person is guilty or innocent based on evidence
Null: The person is innocent
Alternative: The person is not innocent (i.e. guilty)
• The null can only be rejected if there is enough evidence
to doubt it
• i.e. the jury can only convict if there is beyond reasonable
doubt for the null of innocence
• They do not know whether the person is really guilty or
innocent so they may make a mistake

Slide 16
Steps to undertaking a Hypothesis
test
Define study question
Choose a
Set null and alternative hypothesis suitable
test
Calculate a test statistic

Calculate a p-value

Make a decision and interpret


your conclusions

Slide 17
Specify or Set null and alternative hypothesis

 The null hypothesis (H0) is a


statement of no effect,
relationship, or difference
between two or more groups or
factors. In research studies, the
researcher is usually interested in
disproving the null hypothesis.
Forming Hypotheses
If you are conducting a
study and want to use a
hypothesis test to support
your claim, the claim must
be worded so that it
becomes the alternative
hypothesis.
Slide 19
Example:
 There is no significant difference in
intubation rates across ages 0 to 5 years.
 The intervention and control groups have
the same survival rate or the intervention
does not improve survival rate.
 There is no association between injury
type and whether or not the patient
received an IV in the prehospital setting.
• The Alternative hypothesis (Ha) is the
statement that there is an effect or difference.
This is usually the hypothesis the researcher is
interested in proving. The alternative
hypothesis can be one-sided (only provided
one direction, e.g., lower) or two-sided. We
often use two-sided test even when our true
hypothesis is one-sided because it requires
more evidence against the null hypothesis to
accept the alternative hypothesis.
Examples:
• The intubation success rate differs with
the age of the patient being treated.
• The time to resuscitation from cardiac
arrest is lower for the intervention group
than for the control .
• There is an association between injury
type and whether or not the patient
received an IV in the prehospital setting.
Identifying H0 and H1

Slide 23
Example: Identify the Null and Alternative
Hypothesis. Use the given claims to express the
corresponding null and alternative hypotheses
in symbolic form.

a) The proportion of drivers who admit to running red


lights is greater than 0.5. In Step 1 of Figure 8-2, we
express the given claim as p > 0.5. In Step 2, we see
that if p > 0.5 is false, then p  0.5 must be true. In
Step 3, we see that the expression p > 0.5 does not
contain equality, so we let the alternative hypothesis
H1 be p > 0.5, and we let H0 be p = 0.5.

Slide 24
Example: Identify the Null and Alternative
Hypothesis. Use the given claims to express
the corresponding null and alternative
hypotheses in symbolic form.
a) The proportion of drivers who admit to
running red lights is greater than 0.5.

b) The mean height of professional basketball


players is at most 7 ft.

c) The standard deviation of IQ scores of


actors is equal to 15.

Slide 25
Activity:

• Formulate a null hypothesis and its alternative


hypothesis. Write them in symbols.
1. The average TV viewing time of all five-year
old children is 4 hours daily.
2. A college librarian claims that 20 storybooks
on the average are borrowed daily.
3. The mean performance of all grade six
learners of a school in the NAT is 35.

Slide 26
4. The inventor of a new kind of
light bulb claims that all such bulbs
last as long as 3000 hours.
5. The average age of all the
identified stratum of senior citizens
in a remote area is 92 years.
Slide 27
Set the Significance Level
• The significance level (denoted by ) is the
probability that the test statistic will fall in the critical
region when the null hypothesis is actually true
(generally set at 0.05). This means that there is 5%
chance that you will accept your alternative
hypothesis when your null hypothesis is actually true.
The smaller the significance level, the greater the
burden of proof needed to reject the null hypothesis,
or in other words, to support the alternative
hypothesis. Common choices for  are 0.05, 0.01,
and 0.10.
• Slide 28
Calculate the Test Statistic and
the P-value

• Test Statistic
–The test statistic is a value used in
making a decision about the null
hypothesis, and is found by
converting the sample statistic to a
score with the assumption that the
null hypothesis is true.
Slide 29
Calculate the Test Statistic and
the P-value

• The p-value describes the probability of


obtaining a sample statistic as or more
extreme by chance alone if your null
hypothesis is true. This p-value is
determined based on the result of your
test statistic. Your conclusion about the
hypothesis are based on your p-value and
your significance level.
Slide 30
Test Statistic - Formulas


z=p-p Test statistic for


 pq
n
proportions

x - µx Test statistic for


z=
 mean
n

(n – 1)s2 Test statistic for


2 = standard
 2
deviation
Slide 31
Example: A survey of n = 880
randomly selected adult drivers
showed that 56% (or p = 0.56) of
those respondents admitted to
running red lights. Find the
value of the test statistic for the
claim that the majority of all
adult drivers admit to running
red lights.

Slide 32
Solution: The preceding example showed
that the given claim results in the following
null and alternative hypotheses: H0: p = 0.5
and H1: p > 0.5. Because we work under the
assumption that the null hypothesis is true
with p = 0.5, we get the following test statistic:

z = p – p = 0.56 - 0.5 = 3.56




 pq
n  (0.5)(0.5)
880

Slide 33
Interpretation: We know from
previous chapters that a z score of
3.56 is exceptionally large. It appears
that in addition to being “more than
half,” the sample result of 56% is
significantly more than 50%.

See figure following.

Slide 34
Critical Region, Critical Value,
Test Statistic

Slide 35
Critical Region

The critical region (or rejection


region) is the set of all values of
the test statistic that cause us to
reject the null hypothesis. For
example, see the red-shaded
region in the previous figure.

Slide 36
Critical Value
A critical value is any value that separates the
critical region (where we reject the null
hypothesis) from the values of the test statistic
that do not lead to rejection of the null
hypothesis. The critical values depend on the
nature of the null hypothesis, the sampling
distribution that applies, and the significance
level . See the previous figure where the
critical value of z = 1.645 corresponds to a
significance level of  = 0.05.
Slide 37
Two-tailed, Right-tailed,
Left-tailed Tests

The tails in a distribution


are the extreme regions
bounded by critical values.

Slide 38
Two-tailed Test
H0: =  is divided equally between
the two tails of the critical
H1:  region

Means less than or greater than

Slide 39
Right-tailed Test
H0: =
H1: >
Points Right

Slide 40
Left-tailed Test
H0: =
H1: <
Points Left

Slide 41
P-Value
The P-value (or p-value or probability
value) is the probability of getting a value
of the test statistic that is at least as
extreme as the one representing the
sample data, assuming that the null
hypothesis is true. The null hypothesis is
rejected if the P-value is very small, such
as 0.05 or less.

Slide 42
Example: Finding P-values. First determine
whether the given conditions result in a right-
tailed test, a left-tailed test, or a two-tailed test,
then find the P-values and state a conclusion
about the null hypothesis.

a) A significance level of  = 0.05 is used in testing the


claim that p > 0.25, and the sample data result in a test
statistic of z = 1.18.
b) A significance level of  = 0.05 is used in testing the
claim that p  0.25, and the sample data result in a test
statistic of z = 2.34.

Slide 43
Example: Finding P-values. First determine
whether the given conditions result in a right-
tailed test, a left-tailed test, or a two-tailed test,
then find the P-values and state a conclusion
about the null hypothesis.

a) With a claim of p > 0.25, the test is right-tailed. Because the test is right-tailed,
Figure 8-6 shows that the P-value is the area to the right of the test statistic z = 1.18.
We refer to Table A-2 and find that the area to the right of z = 1.18 is 0.1190. The P-
value of 0.1190 is greater than the significance level  = 0.05, so we fail to reject
the null hypothesis. The P-value of 0.1190 is relatively large, indicating that the
sample results could easily occur by chance.

Slide 44
Example: Finding P-values. First determine
whether the given conditions result in a right-
tailed test, a left-tailed test, or a two-tailed test,
then find the P-values and state a conclusion
about the null hypothesis.

b) With a claim of p  0.25, the test is two-tailed. Because the test is two-tailed, and
because the test statistic of z = 2.34 is to the right of the center, Figure 8-6 shows
that the P-value is twice the area to the right of z = 2.34. We refer to Table A-2 and find
that the area to the right of z = 2.34 is 0.0096, so P-value = 2 x 0.0096 = 0.0192.
The P-value of 0.0192 is less than or equal to the significance level, so we reject the
null hypothesis. The small P-value o 0.0192 shows that the sample results are not
likely to occur by chance.

Slide 45
Procedure for Finding P-Values
Figure 8-6

Slide 46
Conclusions
in Hypothesis Testing
We always test the null hypothesis.
The initial conclusion will always be
one of the following:

1. Reject the null hypothesis.

2. Fail to reject the null hypothesis.

Slide 47
Drawing a Conclusion
P-value <= significance level
 => Reject your null hypothesis in
favor of your alternative hypothesis. Your
result is statistically significant.
• P-value > significant level
 => Fail to reject your hypothesis.
Your result is not statistically significant.

Slide 48
Decision Criterion

Traditional method:

Reject H0 if the test statistic falls within


the critical region.

Fail to reject H0 if the test statistic does


not fall within the critical region.

Slide 49
Decision Criterion - cont

P-value method:

Reject H0 if the P-value   (where  is


the significance level, such as 0.05).

Fail to reject H0 if the P-value > .

Slide 50
Decision Criterion - cont

Another option:

Instead of using a significance level such


as 0.05, simply identify the P-value and
leave the decision to the reader.

Slide 51
Decision Criterion - cont

Confidence Intervals:

Because a confidence interval estimate of a


population parameter contains the likely
values of that parameter, reject a claim that
the population parameter has a value that
is not included in the confidence interval.

Slide 52
Wording of Final Conclusion

Figure 8-7
Slide 53
Accept Versus Fail to Reject

 Some texts use “accept the null


hypothesis.”

 We are not proving the null hypothesis.


 The sample evidence is not strong
enough to warrant rejection
(such as not enough evidence to
convict a suspect).

Slide 54
Type I Error

 A Type I error is the mistake of


rejecting the null hypothesis when it
is true.

 The symbol  (alpha) is used to


represent the probability of a type I
error.

Slide 55
Type II Error

 A Type II error is the mistake of failing


to reject the null hypothesis when it is
false.

 The symbol  (beta) is used to


represent the probability of a type II
error.

Slide 56
Example: Assume that we a conducting
a hypothesis test of the claim p > 0.5.
Here are the null and alternative
hypotheses: H0: p = 0.5, and H1: p > 0.5.

a) Identify a type I error.


b) Identify a type II error.

Slide 57
Example: Assume that we a conducting
a hypothesis test of the claim p > 0.5.
Here are the null and alternative
hypotheses: H0: p = 0.5, and H1: p > 0.5.

a) A type I error is the mistake of rejecting a true null


hypothesis, so this is a type I error: Conclude that
there is sufficient evidence to support p > 0.5, when in
reality p = 0.5.

Slide 58
Example: Assume that we a conducting
a hypothesis test of the claim p > 0.5.
Here are the null and alternative
hypotheses: H0: p = 0.5, and H1: p > 0.5.

b) A type II error is the mistake of failing to reject the


null hypothesis when it is false, so this is a type II
error: Fail to reject p = 0.5 (and therefore fail to
support p > 0.5) when in reality p > 0.5.

Slide 59
Type I and Type II Errors

Slide 60

You might also like