Title: MATH 200
1MATH 200 INTRODUCTION TO STATISTICS CHAPTER 8
Hypothesis Testing
2- Definition
- Hypothesis
- In statistics, a hypothesis is a claim or
statement about a property of a population.
3Rare Event Rule for Inferential Statistics
- If, under a given assumption,
- the probability of an observed event
- is exceptionally small,
- we conclude that
- the assumption is probably not correct.
4Central Limit Theorem
- The Expected Distribution of Sample Means
Assuming that ? 98.6
Likely sample means
or z - 6.64
Sample data x 98.20
µx 98.6
5Components of aFormal Hypothesis Test
6Null Hypothesis H0
- Statement about the value of a POPULATION
PARAMETER - Must contain condition of EQUALITY , , or
- Test the Null Hypothesis directly
- Reject H0 or fail to reject H0
7Alternative Hypothesis H1
- Must be true if H0 is false
- Must contain condition of INEQUALITY ? , lt ,
or gt - Opposite of Null Hypothesis
8Test Statistic
- A value computed from the sample data that is
used in making the decision about whether to
reject the null hypothesis
- For large samples, when testing claims about
population means, the test statistic is a
z-score corresponding to the sample mean.
9Critical Region
- Set of all values of the test statistic that
would cause a rejection of the - null hypothesis
Critical Region
10Critical Region
- Set of all values of the test statistic that
would cause a rejection of the - null hypothesis
Critical Region
11Critical Region
- Set of all values of the test statistic that
would cause a rejection of the - null hypothesis
Critical Regions
12Significance Level
- denoted by ?
- the probability that the test statistic will fall
in the critical region when the null hypothesis
is actually true. - common choices are 0.05, 0.01, and 0.10
13Critical Value
- Value or values that separate the critical region
(where we reject the null hypothesis) from the
values of the test statistics that do not lead
to a rejection of the null hypothesis
Fail to reject H0
Reject H0
Critical Value ( z score )
14Two-tailed, Right-tailed,Left-tailed Tests
- The tails in a distribution are the extreme
regions bounded - by critical values.
15Two-tailed Test
? is divided equally between the two tails of
the critical region
UNEQUAL means less than or greater than
Reject H0
Fail to reject H0
Reject H0
100
Values that differ significantly from 100
16Right-tailed Test
Values that differ significantly from 100
100
17Left-tailed Test
Fail to reject H0
Reject H0
Values that differ significantly from 100
100
18Conclusions in Hypothesis Testing
- Always test the NULL hypothesis
- Reject H0
- Fail to reject H0
- Be careful to include the correct wording of the
final conclusion
or
19Wording of Final Conclusion
Start
Only case in which original claim is rejected
Claim contains equality?
There is sufficient evidence to reject the
claim that. . . (original claim).
Yes
Yes Claim becomes H0
Reject H0?
No
There is not sufficient evidence to reject
the claim that (original claim).
No Claim becomes H1
Only case in which original claim is
supported
There is sufficient evidence to support the
claim that . . . (original claim).
Yes
Reject H0?
No
There is not sufficient evidence to support
the claim that (original claim).
20Fail to Reject versus Accept
- Some texts use accept the null hypothesis
- We are not proving the null hypothesis (cant
PROVE equality) - If the sample evidence is not strong enough to
warrant rejection, then the null hypothesis may
or may not be true (just as a defendant found NOT
GUILTY may or may not be innocent)
21Type I Error
- Rejecting the null hypothesis when it is true.
- ???(alpha) represents the probability of a type
I error - Example Rejecting a claim that the mean body
temperature is 98.6 degrees when the mean really
is 98.6
22Type II Error
- Failing to reject the null hypothesis when it is
false. - ß (beta) represents the probability of a type
II error - Example Failing to reject the claim that the
mean body temperature is 98.6 degrees when the
mean really isnt 98.6
23Type I and Type II Errors
NULL HYPOTHESIS
TRUE
FALSE
Type I error a Rejecting a true null hypothesis
Reject the null hypothesis
CORRECT
DECISION
Type II error ß Failing to reject a false null
hypothesis
Fail to reject the null hypothesis
CORRECT
24Controlling Type I and Type II Errors
- ?, ?, and n are interrelated. If one is kept
constant, then an increase in one of the
remaining two will cause a decrease in the other.
- For any fixed ?, an increase in the sample size n
will cause a ??????? in ?? - For any fixed sample size n , a decrease in ?
will cause a ??????? in ?. - Conversely, an increase in ? will cause a ???????
in ? . - To decrease both ? and ?, ??????? the sample
size n.
25Hypothesis Testing Large Samples
26Assumptions
- for testing claims about population means
- The sample is a simple random sample.
- The sample is large (n gt 30).
- a) Central limit theorem applies
- b) Can use normal distribution
- If ? is unknown, we can use sample standard
deviation s as estimate for ?.
27P-Value Methodof Testing Hypotheses
- Goal is to determine whether a sample result is
significantly different from the claimed value - Finds the probability (P-value) of getting a
result and rejects the null hypothesis if that
probability is very low
28Rare Event Rule for Inferential Statistics
- If, under a given assumption,
- the probability of an observed event
- is exceptionally small,
- we conclude that
- the assumption is probably not correct.
29P-Value Methodof Testing Hypotheses
- Definition
- P-Value (or probability value)
- The probability of getting a value of the sample
test statistic that is at least as extreme as the
one found from the sample data, assuming that the
null hypothesis is true
30TRADITIONAL METHOD
critical region
- Use significance level to determine critical
region.
Z0
- Calculate test statistic by converting sample
mean to a z-score.
critical value
- Reject H0 if the test statistic falls in the
critical region.
P-value area of this region
P-VALUE METHOD
- Calculate p-value of sample mean, assuming that
H0 is true.
_ x
µ (according to H0)
- Reject H0 if the p-value is less than the
significance level ?.
31P-value Method of Testing Hypotheses
- Write the CLAIM in symbolic form.
- Write H0 and H1. If the claim contains equality,
it becomes H0. Otherwise it becomes H1. The other
hypothesis is the symbolic form that must be true
when the original claim is false.
- Select the significance level ? based on the
seriousness of a type I error. Make ? small if
the consequences of rejecting a true H0 are
severe. Values of 0.05 and 0.01 are very common.
Often the significance level will be given.
- Identify the appropriate distribution (normal
distribution or t distribution).
- Find the P-value and draw a graph.
- Reject the null hypothesis if the P-value is less
than or equal to the significance level ?
- Fail to reject the null hypothesis if the P-value
is greater than the significance level ?
- Write the CONCLUSION in simple non-technical
terms.
32Wording of Final Conclusion
Start
Only case in which original claim is rejected
Claim contains equality?
There is sufficient evidence to reject the
claim that. . . (original claim).
Yes
Yes Claim becomes H0
Reject H0?
No
There is not sufficient evidence to reject
the claim that (original claim).
No Claim becomes H1
Only case in which original claim is
supported
There is sufficient evidence to support the
claim that . . . (original claim).
Yes
Reject H0?
No
There is not sufficient evidence to support
the claim that (original claim).
33Example The body temperatures of 106 healthy
adults were recorded. The mean was 98.2o and s
was 0.62o. At the 0.05 significance level, test
the claim that the mean body temperature of ALL
healthy adults is equal to 98.6o.
H1 µ ? 98.6
? x 98.2
µ 98.6
- Normal distribution (n gt 30)
34To Determine the P-value
STAT, TESTS, Z-Test Inpt Stats µ0 98.6
(population mean according to H0) s 0.62 (can
use s because n gt 30) x 98.2 (sample mean) n
106 (sample size) µ ? µ0 (according to
H1) CALCULATE (Can use DRAW to see the graph)
Calculator returns P 3.1039E-11, which is
equal to 0.000000000031039. Round to 0.
35Example The body temperatures of 106 healthy
adults were recorded. The mean was 98.2o and s
was 0.62o. At the 0.05 significance level, test
the claim that the mean body temperature of ALL
healthy adults is equal to 98.6o.
H1 µ ? 98.6
? x 98.2
µ 98.6
P 0
- Decision
- Reject H0 because P lt .05
- Normal distribution (n gt 30)
36Wording of Final Conclusion
Start
Only case in which original claim is rejected
Claim contains equality?
There is sufficient evidence to reject the
claim that. . . (original claim).
Yes
Yes Claim becomes H0
Reject H0?
No
There is not sufficient evidence to reject
the claim that (original claim).
No Claim becomes H1
Only case in which original claim is
supported
There is sufficient evidence to support the
claim that . . . (original claim).
Yes
Reject H0?
No
There is not sufficient evidence to support
the claim that (original claim).
37Example The body temperatures of 106 healthy
adults were recorded. The mean was 98.2o and s
was 0.62o. At the 0.05 significance level, test
the claim that the mean body temperature of ALL
healthy adults is equal to 98.6o.
H1 µ ? 98.6
? x 98.2
µ 98.6
P 0
- Decision
- Reject H0 because P lt .05
- Normal distribution (n gt 30)
- Conclusion There is sufficient evidence to
reject the claim that the mean body temperature
for healthy adults is 98.6.
38 Rationale of Hypotheses Testing
- Based on RARE EVENT PRINCIPLE If, under a given
assumption, the probability of getting an
observed result is very small, we conclude that
the assumption is probably not correct. - When testing a claim, we make an assumption
(null hypothesis) that contains equality. We
compare the assumption and the sample results and
form one of the following conclusions
- If the sample results can easily occur when the
assumption (null hypothesis) is true, we
attribute the relatively small discrepancy
between the assumption and the sample results to
chance.
- If the sample results cannot easily occur when
the assumption (null hypothesis) is true, we
explain the relatively large discrepancy between
the assumption and the sample by concluding that
the assumption is not true.
39Hypothesis Testing Small Samples
40Assumptions
- for testing claims about population means
- The sample is a simple random sample.
- The sample is small (n lt 30).
- The value of the population standard deviation ?
is unknown. - The sample values come from a population with a
distribution that is approximately normal.
41Test Statistic for a Student t-distribution
x -µx
t
s
n
- Degrees of freedom (df) n -1
42Important Properties of the Student t
Distribution
- 1. The Student t distribution is different for
different sample sizes (see Figure 6-5 in Section
6-3). - 2. The Student t distribution has the same
general bell shape as the normal distribution
its wider shape reflects the greater variability
that is expected with small samples. - 3. The Student t distribution has a mean of t 0
(just as the standard normal distribution has a
mean of z 0). - 4. The standard deviation of the Student t
distribution varies with the sample size and is
greater than 1 (unlike the standard normal
distribution, which has a ??? 1). - 5. As the sample size n gets larger, the Student
t distribution get closer to the normal
distribution. For values of n gt 30, the
differences are so small that we can use the
critical z values instead of developing a much
larger table of critical t values.
43Choosing between the Normal and Student
t-Distributionswhen Testing a Claim about a
Population Mean µ
Start
Use NORMAL distribution
Yes
n gt 30?
Use s if ? is unknown.
No
Is ? known ?
Use NORMAL distribution Extremely unusual!
Is ? known?
Population normally distributed?
Yes
Yes
No
No
Use nonparametric methods (not covered in this
course)
Use STUDENT t distribution
44EXAMPLE Chicken FeedUsing regular feed, a
poultry farmers newborn chickens have normally
distributed weights with a mean of 62.5 oz. With
enriched feed, the weights (in ounces) shown
below were observed 61.4 62.2 66.9 63.3 66.2 66.
0 63.1 63.7 66.6 Use a .05 significance level to
test the claim that the mean weight is higher
with the enriched feed.
5.
P .013
? x
µ 62.5
P .013
6. P lt .05 so reject H0
7. There is sufficient evidence to support the
claim that the mean weight is higher than 62.5
oz. with the enriched chicken feed.
- t distribution because n 30
45The larger Student t critical value shows that
with a small sample, the sample evidence must be
more extreme before we consider the difference is
significant.
EXAMPLE Given µ0 2, s 1, x 2.3, µ ? µ0
_
Use a Z-test to find the P-value with n 50.
Use a t-test to find the P-value with n 20.
P 0.0339
P 0.1955
46Hypothesis Testing Proportions
47Assumptions
- The sample is a simple random sample.
- There is a fixed number of independent trials,
two categories of outcomes, and constant
probabilities for each trial. - The normal distribution can be used to
approximate the distribution of sample
proportions because np ? 5 and nq ? 5 are both
satisfied.
48Notation
n number of trials
?
p x/n (sample proportion)
- p population proportion
- (used in the null hypothesis)
- q 1 - p
49Test Statistic for Testing a Claim about a
Proportion
?
p - p
z
pq
n
50P-value Method
Use the same procedure used on previous
hypothesis tests.
- Reject the null hypothesis if the P-value is less
than or equal to the significance level ?.
51?
p sometimes is given directly 10 of the
observed sports cars are red is expressed
as p 0.10
?
?
p sometimes must be calculated 96 surveyed
households have cable TV
and 54 do not is calculated using
?
x
96
p 0.64
n
(9654)
- (determining the sample proportion of households
with cable TV)
52Example A survey showed that among 785 randomly
selected factory workers, 23.7 smoke. Use a .01
level of significance to test the claim that the
rate of smoking among factory workers is less
than the 27 rate for the general population.
5. Use 1-PropZTest. .237 x 785 186.045 Use
186 for x. Graph not necessary for test of
proportion P 0.018
- Fail to reject H0 because p gt .01
- Normal distribution because n gt 30
7. There is not sufficient evidence to support
the claim that the rate of smoking among factory
workers is less than the 27 rate for the general
population.