Hypothesis Testing
Niranjan S. Kanaki
KBIPER
Hypothesis
In statistics, hypothesis is a claim or
statement about a property of a
population
Hypothesis Testing
is a standard procedure for testing a
claim about a property of a population
Purpose
The purpose of hypothesis testing is
to help in reaching a decision
concerning a population by examining
a sample from that population
Components of a
Hypothesis Test
• Null and alternative hypotheses
• Test statistic
• P-value and interpretation
• Significance level (optional)
Null Hypothesis: H0
Statement about value of population
parameter that is equal to some
claimed value
H0: p = 0.5 H0: = 100 H0: = 15
Test the Null Hypothesis directly
Reject H0 or fail to reject H0
Alternative Hypothesis: H1
the statement that the
parameter has a value that
somehow differs from the null
Must be true if H0 is false
, <, >
H0: Must contain equality
H1: Will contain , <, >
Forming Your Own Claims (Hypotheses)
Convert the research question to null
and alternative hypotheses
The claim must be worded so that it
becomes the alternative hypothesis.
This means your claim must be
expressed using only , <, >
Forming Your Own Claims (Hypotheses)
The null hypothesis (H0) is a claim of “no
difference in the populations”
The alternative hypothesis (Ha) claims
“H0 is false”
Collect data and seek evidence against
H0 as a way of bolstering Ha (deduction)
Test Statistic
The test statistic is a value computed
from the sample data.
It is used in making the decision about
the rejection of the null hypothesis.
Test statistic for proportions
z=p-p
pq
n
Test statistic for mean
x - µx x - µx
z= t=
s
n n
When the population When the population
variance is known variance is not known
Test statistic for standard
deviation
(n – 1)s2
2 =
Example: A survey of n = 880 randomly ˆ
selected Pharm.D. students showed that 56%(or p = 0.56)
of them were girls. Find the value of the test statistic for
the hypothesis that the majority of the Pharm.D. students
are girls.
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
Critical Region (or Rejection Region)
Set of all values of the test statistic that
would cause a rejection of the
null hypothesis
Critical Region
Set of all values of the test statistic that
would cause a rejection of the
null hypothesis
Critical
Region
Critical Region
Set of all values of the test statistic that
would cause a rejection of the
null hypothesis
Critical
Region
Critical Region
Set of all values of the test statistic that
would cause a rejection of the
null hypothesis
Critical
Regions
Significance Level
denoted by
the probability that the test statistic
will fall in the critical region when the
null hypothesis is actually true.
commonly used values are 0.05, 0.01,
and 0.10
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.
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.
Critical Value
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
a rejection of the null hypothesis
Critical Value
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
a rejection of the null hypothesis
Critical Value
( z score )
Critical Value
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
a rejection of the null hypothesis
Reject H0 Fail to reject H0
Critical Value
( z score )
Two-tailed,
Right-tailed,
Left-tailed Tests
The tails in a distribution are the
extreme regions bounded
by critical values.
Two-tailed Test
H0: = is divided equally between
H1: the two tails of the critical
region
Means less than or greater than
Values that differ significantly from H0
Right-tailed Test
H0 : =
H1 : > Points Right
Values that
differ significantly
from Ho
Left-tailed Test
H0 : =
H1 : <
Points Left
Values that
differ significantly
from Ho
P-Value
Observed significance level
• P-value (or p-value or probability value)
• 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.
P-Value
Observed significance level
• p-value is the probability of making an α error
p-value = P(α error)
• Measure of the strength of evidence the
sample data provides against the null
hypothesis
• The null hypothesis is rejected if the P-value is
very small, such as 0.05 or less.
Conclusions
in Hypothesis Testing
always test the null hypothesis
1. Reject the H0
2. Fail to reject the H0
Wording
the
Final Conclusion
Accept versus Fail to Reject
Some texts use “accept the null
hypothesis”…this is BAD
We are not proving the null hypothesis
Sample evidence is not strong enough
to warrant rejection (such as not
enough evidence to convict a suspect)
Decision Criterion
Traditional method
(using statistical table)
• 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.
Decision Criterion
P-value method
• Reject H0 if P-value (where is the
significance level, such as 0.05).
• Fail to reject H0 if P-value > .
Decision Criterion
Another option
• Instead of using a significance level such
as 0.05, simply identify the P-value and
leave the decision to the reader.
Decision Criterion
Confidence Intervals
• Reject H0 if the sample parameter has a
value that is not included in the
confidence interval.
Confidence intervals
Calculating confidence interval using a z-distribution
– when population variance is known
Calculating confidence interval using a t-distribution –
when population variance is not known