Professional Documents
Culture Documents
Decisions
Hypothesis Testing
2
Null and Alternative Hypothesis
3
Developing Null-Alternative Hypothesis
◼ But, is it true ?
4
Developing Null-Alternative Hypothesis
5
Developing Null-Alternative Hypothesis
6
Developing Null-Alternative Hypothesis
7
Summary of Forms for Null and Alternative
Hypotheses about a Population Mean
The equality part of the hypotheses always appears in the null hypothesis.
In general, a hypothesis test about the value of a population mean must take
one of the following three forms (where 0 is the hypothesized value of the
population mean).
H 0 : 0 H 0 : 0 H 0 : = 0
H a : 0 H a : 0 H a : 0
8
Null and Alternative Hypotheses
9
Null and Alternative Hypotheses
where: = mean response time for the population of medical emergency requests
10
Type I Error
Because hypothesis tests are based on sample data, we must allow for the possibility of errors.
A Type I error is rejecting H0 when it is true.
The probability of making a Type I error when the null hypothesis is true as an equality is called
the level of significance.
Applications of hypothesis testing that only control the Type I error are often called significance
tests.
11
Type II Error
12
Type I and Type II Error
Population Condition
H0 True H0 False
Conclusion ( < 12) ( > 12)
Reject H0 Correct
Type I Error
(Conclude > 12) Decision
13
Steps of Hypothesis Testing
14
One-Tailed Tests About a Population Mean:
s Known
◼ Example: Metro EMS
A major west coast city provides one of the most comprehensive emergency medical services in the
world. Operating in a multiple hospital system with approximately 20 mobile medical units, the
service goal is to respond to medical emergencies with a mean time of 12 minutes or less.
The director of medical services wants to formulate a hypothesis test that could use a sample of
emergency response times to determine whether or not the service goal of 12 minutes or less is being
achieved.
The response times for a random sample of 40 medical emergencies were tabulated. The sample mean
is 13.25 minutes. The population standard deviation is believed to be 3.2 minutes.
The EMS director wants to perform a hypothesis test, with a .05 level of significance, to determine
whether the service goal of 12 minutes or less is being achieved.
15
One-tailed (upper-tail) Hypothesis Test:
s Known
1 - of all
x values
𝛼
𝜇0 𝑥ҧ𝛼 𝑥ҧ
16
One-tailed (upper-tail) Hypothesis Test:
s Known
1 - of all
x values
𝛼
𝜇4 𝜇3 𝜇0 𝜇1 𝑥ҧ𝛼 𝜇2 𝑥ҧ
17
One-tailed (upper-tail) Hypothesis Test:
s Known
𝑥ҧ − 𝜇0
𝑧= 𝜎
𝑛
1 - of all
z values
𝛼
0 𝑧𝛼 𝑧
18
One-Tailed (upper-tail) Tests about a Population Mean:
s Known
◼ Critical Value and p -Value Approaches
H0:
1. Develop the hypotheses.
Ha:
19
One-Tailed (upper-tail) Tests about a Population Mean:
s Known
◼ Critical Value Approaches
There is sufficient statistical evidence to infer that Metro EMS is not meeting
the response goal of 12 minutes.
20
One-Tailed (upper-tail) Tests about a Population Mean:
s Known
◼ p -Value Approaches
Sampling
distribution = .05
of z = x − 0
s/ n
p-value
=
z
0 z = z statistics=
1.645 2.47
21
One-Tailed Tests (upper-tail) about a Population Mean:
s Known
◼ p -Value Approaches
22
p-Value Approach to
One-Tailed Hypothesis Testing
The p-value is the probability, computed using the test statistic, that measures the support (or lack of
support) provided by the sample for the null hypothesis.
If the p-value is less than or equal to the level of significance , the value of the test statistic is in the
rejection region.
Reject H0 if the p-value < .
23
One-Tailed Tests (lower-tail) about a Population Mean:
s Known
◼ Consider the case of a wholesaler that buys lightbulbs from the manufacturer.
The wholesaler buys the bulbs in large lots and does not want to accept a lot of
bulbs unless the mean life is atleast 1000 hours. As each shipment arrives, the
wholesaler tests a sample to determine whether it should accept the shipment or
not. The company will reject the shipment only if it feels that the mean life is
below 1000 hours
𝐻0 : μ ≥ 1000
𝐻𝑎 : μ < 1000
They collected a random sample of 40 lightbulbs. The mean life is 992.6 hours. The
population standard deviation is believed to be 32 hours. The wholesaler wants to
perform a hypothesis test, with a 0.10 level of significance.
24
One-tailed (lower-tail) Hypothesis Test:
s Known
1 - of all
x values
𝛼
𝑥ҧ𝛼 𝜇0 𝑥ҧ
25
One-tailed (lower-tail) Hypothesis Test:
s Known
1 - of all
x values
𝛼
𝜇4 𝑥ҧ𝛼 𝜇3 𝜇0 𝜇1 𝜇2 𝑥ҧ
26
One-tailed (lower-tail) Hypothesis Test:
s Known
𝑥ҧ − 𝜇0
𝑧= 𝜎
𝑛
1 - of all
z values
𝛼
−𝑧𝛼 0 𝑧
27
One-Tailed (lower-tail) test about a Population Mean:
s Known
◼ Critical Value and p -Value Approaches
H0:
1. Develop the hypotheses.
Ha:
28
One-Tailed (lower-tail) test about a Population Mean:
s Known
◼ Critical Value Approaches
29
One-Tailed (lower-tail) test about a Population Mean:
s Known
◼ p -Value Approaches p-Value < ,
so reject H0.
= .10 Sampling
distribution
x − 0
of z =
s/ n
p-value
= 7
z
z = -z = 0
-1.46 -1.28
30
One-Tailed Tests About a Population Mean:
s Known
◼ p -Value Approaches
31
Critical Value Approach to
One-Tailed Hypothesis Testing
◼ The test statistic z has a standard normal probability distribution.
◼ We can use the standard normal probability distribution table to find the z-value with an area of
in the lower (or upper) tail of the distribution.
The value of the test statistic that established the boundary of the rejection region is called the
critical value for the test.
The rejection rule is:
➢ Lower tail: Reject H0 if z < -z
➢ Upper tail: Reject H0 if z > z
32
p-Value Approach to
Two-Tailed Hypothesis Testing
◼ Compute the p-value using the following three steps:
1. Compute the value of the test statistic z.
2. If z is in the upper tail (z > 0), compute the probability that z is greater than or equal to the value of
the test statistic. If z is in the lower tail (z < 0), compute the probability that z is less than or equal
to the value of the test statistic.
3. Double the tail area obtained in step 2 to obtain the p –value.
◼ The rejection rule:
Reject H0 if the p-value < .
33
Critical Value Approach to
Two-Tailed Hypothesis Testing
◼ The critical values will occur in both the lower and upper tails of the standard normal curve.
◼ Use the standard normal probability distribution table to find z/2 (the z-value with an area of /2
in the upper tail of the distribution).
◼ The rejection rule is:
Reject H0 if z < -z/2 or z > z/2.
34
Two-Tailed Tests About a Population Mean:
s Known
◼ Example: Glow Toothpaste
The production line for Glow toothpaste is designed to fill tubes with a mean weight of 6 oz.
Periodically, a sample of 30 tubes will be selected in order to check the filling process.
Quality assurance procedures call for the continuation of the filling process if the sample results are
consistent with the assumption that the mean filling weight for the population of toothpaste tubes is 6
oz.; otherwise the process will be adjusted.
Assume that a sample of 30 toothpaste tubes provides a sample mean of 6.1 oz. The population
standard deviation is believed to be 0.2 oz.
Perform a hypothesis test, at the .03 level of significance, to help determine whether the filling process
should continue operating or be stopped and corrected.
35
Two-tailed Hypothesis Test:
s Known
1 - of all
x values
𝛼/2 𝛼/2
36
Two-tailed Hypothesis Test:
s Known
1 - of all
x values
𝛼/2 𝛼/2
𝜇4 𝜇3 𝜇0 𝜇1 𝑥ҧ𝐵𝛼/2 𝜇2 𝑥ҧ
𝑥𝐴ҧ 𝛼/2
37
Two-tailed Hypothesis Test:
s Known
𝑥ҧ − 𝜇0
𝑧= 𝜎
𝑛
1 - of all
z values
𝛼/2 𝛼/2
−𝑧𝛼/2 0 +𝑧𝛼/2 𝑧
38
Two-Tailed Tests About a Population Mean:
s Known
H0: =
1. Determine the hypotheses. Ha: ≠
39
Two-Tailed Tests About a Population Mean:
s Known
40
Two-Tailed Tests About a Population Mean:
s Known
Sampling
distribution
of z = x − 0
s/ n
z
-2.17 0 2.17
41
Two-Tailed Tests About a Population Mean:
s Known
◼ p –Value Approach
1/2 1/2
p -value p -value
= .0031 = .0031
/2 = /2 =
.015 .015
z
z = -2.74 0 z = 2.74
-z/2 = -2.17 z/2 = 2.17
42
Two-Tailed Tests About a Population Mean:
s Known
◼ p –Value Approach
43
Summary till Now
44
If population standard deviation (𝜎) is known
One-Tailed (upper-tail) Tests
H0: 0
1) Develop the hypotheses:
Ha: 0
2) Specify the level of significance:
ҧ 0
𝑥−𝜇
3) Compute the value of the test statistic: 𝑧𝑠𝑡𝑎𝑡 = 𝜎
𝑛 𝑝
4) Determine the critical value: 𝑍𝛼 [from z distribution table]
𝑧
5) Reject H0 if 𝑧𝑠𝑡𝑎𝑡 ≥ 𝑍𝛼 0
6) Compute the p-value: 𝑝𝑟𝑜𝑏 𝑧 ≥ 𝑧𝑠𝑡𝑎𝑡 = 1 − 𝑝𝑟𝑜𝑏 𝑧 ≤ 𝑧𝑠𝑡𝑎𝑡 𝑍𝛼 𝑧𝑠𝑡𝑎𝑡
7) Reject H0 if 𝑝 ≤𝛼
H0: ≥ 0
1) Develop the hypotheses:
Ha: 0
2) Specify the level of significance:
ҧ 0
𝑥−𝜇
3) Compute the value of the test statistic: 𝑧𝑠𝑡𝑎𝑡 = 𝜎 𝑝
𝑛
4) Determine the critical value: −𝑍𝛼 [from z distribution table]
𝑧
5) Reject H0 if 𝑧𝑠𝑡𝑎𝑡 ≤ −𝑍𝛼 0
6) Compute the p-value: 𝑝𝑟𝑜𝑏 𝑧 ≤ 𝑧𝑠𝑡𝑎𝑡
𝑧𝑠𝑡𝑎𝑡 −𝑍𝛼
7) Reject H0 if 𝑝 ≤𝛼
Steps 1-5 -> Critical value approach
Steps 1-3, and Steps 6-7 -> p - value approach 46
If population standard deviation (𝜎) is known
Two-Tailed Tests
H0: = 0
1) Develop the hypotheses:
Ha: ≠ 0
/ /
2) Specify the level of significance:
ҧ 0
𝑥−𝜇
3) Compute the value of the test statistic: 𝑧𝑠𝑡𝑎𝑡 = 𝜎 𝑝/2
𝑛 𝑝/2
4) Determine critical values: 𝑍𝛼/2 & −𝑍𝛼/2 [from z table]
𝑧
5) Reject H0 if 𝑧𝑠𝑡𝑎𝑡 ≤ −𝑍𝛼/2 or 𝑧𝑠𝑡𝑎𝑡 ≥ 𝑍𝛼/2 0
6) Compute the p-value: 2 ∗ 𝑝𝑟𝑜𝑏 𝑧 ≤ 𝑧𝑠𝑡𝑎𝑡 if 𝑧𝑠𝑡𝑎𝑡 < 0 𝑧𝑠𝑡𝑎𝑡 −𝑍𝛼/2 +𝑍𝛼/2 𝑧𝑠𝑡𝑎𝑡
or 2 ∗ 𝑝𝑟𝑜𝑏 𝑧 ≥ 𝑧𝑠𝑡𝑎𝑡 if 𝑧𝑠𝑡𝑎𝑡 > 0
48
If population standard deviation (𝜎) is unknown
One-Tailed (upper-tail) Tests
H0: 0
1) Develop the hypotheses:
Ha: 0
2) Specify the level of significance:
ҧ 0
𝑥−𝜇
3) Compute the value of the test statistic: 𝑡𝑠𝑡𝑎𝑡 = 𝑠
𝑛 𝑝
4) Determine the critical value: 𝑡𝛼 [from t distribution table/excel]
𝑡
5) Reject H0 if 𝑡𝑠𝑡𝑎𝑡 ≥ 𝑡𝛼 0
6) Compute the p-value: 𝑝𝑟𝑜𝑏 𝑡 ≥ 𝑡𝑠𝑡𝑎𝑡 𝑡𝛼 𝑡𝑠𝑡𝑎𝑡
49
If population standard deviation (𝜎) is unknown
One-Tailed (lower-tail) Tests
H0: ≥ 0
1) Develop the hypotheses:
Ha: 0
2) Specify the level of significance:
ҧ 0
𝑥−𝜇
3) Compute the value of the test statistic: 𝑡𝑠𝑡𝑎𝑡 = 𝑠 𝑝
𝑛
4) Determine the critical value: −𝑡𝛼 [from t distribution table/excel]
𝑡
5) Reject H0 if 𝑡𝑠𝑡𝑎𝑡 ≤ −𝑡𝛼 0
6) Compute the p-value: 𝑝𝑟𝑜𝑏 𝑡 ≤ 𝑡𝑠𝑡𝑎𝑡
𝑡𝑠𝑡𝑎𝑡 −𝑡𝛼
7) Reject H0 if 𝑝 ≤𝛼
Steps 1-5 -> Critical value approach
Steps 1-3, and Steps 6-7 -> p - value approach
50
If population standard deviation (𝜎) is unknown
Two-Tailed Tests
H0: = 0
1) Develop the hypotheses:
Ha: ≠ 0
/ /
2) Specify the level of significance:
ҧ 0
𝑥−𝜇
3) Compute the value of the test statistic: 𝑡𝑠𝑡𝑎𝑡 = 𝑠 𝑝/2
𝑛 𝑝/2
4) Determine critical values: 𝑡𝛼/2 & −𝑡𝛼/2 [from t table/excel]
𝑡
5) Reject H0 if 𝑡𝑠𝑡𝑎𝑡 ≥ 𝑡𝛼/2 or 𝑡𝑠𝑡𝑎𝑡 ≤ −𝑡𝛼/2 0
6) Compute the p-value: 2 ∗ 𝑝𝑟𝑜𝑏 𝑡 ≤ 𝑡𝑠𝑡𝑎𝑡 if 𝑡𝑠𝑡𝑎𝑡 < 0 𝑡𝑠𝑡𝑎𝑡 −𝑡𝛼/2 +𝑡𝛼/2 𝑡𝑠𝑡𝑎𝑡
or 2 ∗ 𝑝𝑟𝑜𝑏 𝑡 ≥ 𝑡𝑠𝑡𝑎𝑡 if 𝑡𝑠𝑡𝑎𝑡 > 0
52
p -Values and the t Distribution
◼ The format of the t distribution table provided in most statistics textbooks does
not have sufficient detail to determine the exact p-value for a hypothesis test.
◼ However, we can still use the t distribution table to identify a range for the p-
value.
◼ An advantage of computer software packages is that the computer output will
provide the p-value for the t distribution.
53
Example: Highway Patrol
A State Highway Patrol periodically samples vehicle speeds at various locations on a particular
roadway. The sample of vehicle speeds is used to test the hypothesis H0: < 65.
The locations where H0 is rejected are deemed the best locations for radar traps. At Location F, a
sample of 64 vehicles shows a mean speed of 66.2 mph with a standard deviation of 4.2 mph. Use =
.05 to test the hypothesis.
54
One-Tailed Test About a Population Mean:
s Unknown
◼ p –Value and Critical Value Approaches
H0: < 65
1. Determine the hypotheses. Ha: > 65
55
One-Tailed Test About a Population Mean:
s Unknown
◼ Critical Value Approach
We are at least 95% confident that the mean speed of vehicles at Location
F is greater than 65 mph. Location F is a good candidate for a radar trap.
56
One-Tailed Test About a Population Mean:
s Unknown
◼ p –Value Approach
57
One-Tailed Test About a Population Mean:
s Unknown
Reject H0
Do Not Reject H0
=
t
0 t =
1.669
58
Calculating the Probability of a Type II Error
in Hypothesis Tests About a Population Mean
1. Formulate the null and alternative hypotheses.
2. Using the critical value approach, use the level of significance to determine the critical value and
the rejection rule for the test.
3. Using the rejection rule, solve for the value of the sample mean corresponding to the critical value
of the test statistic.
4. Use the results from step 3 to state the values of the sample mean that lead to the acceptance of H0;
this defines the acceptance region.
5. Using the sampling distribution of 𝑥ҧ for a value of satisfying the alternative hypothesis, and the
acceptance region from step 4, compute the probability that the sample mean will be in the
acceptance region. (This is the probability of making a Type II error at the chosen level of .)
59
Calculating the Probability
of a Type II Error
◼ Example: Metro EMS
A major west coast city provides one of the most comprehensive emergency medical services in the
world. Operating in a multiple hospital system with approximately 20 mobile medical units, the
service goal is to respond to medical emergencies with a mean time of 12 minutes or less.
The director of medical services wants to formulate a hypothesis test that could use a sample of
emergency response times to determine whether or not the service goal of 12 minutes or less is being
achieved.
The response times for a random sample of 40 medical emergencies were tabulated. The sample mean
is 13.25 minutes. The population standard deviation is believed to be 3.2 minutes.
The EMS director wants to perform a hypothesis test, with a .05 level of significance, to determine
whether the service goal of 12 minutes or less is being achieved.
60
Calculating the Probability
of a Type II Error
61
Calculating the Probability
of a Type II Error
Sampling
distribution c
of 𝑥ҧ when
Reject H0 H0:
H0 is true
Ha:
and = 12
x
12 Sampling
distribution
of 𝑥ҧ when
H0 is false
Note:
and a > 12
b
x
c a 62
Calculating the Probability
of a Type II Error
5. Probabilities that the sample mean will be in the acceptance region:
12.8323 −
z=
Values of 3.2 / 40 b 1-b
14.0 -2.31 .0104 .9896
13.6 -1.52 .0643 .9357
13.2 -0.73 .2327 .7673
12.8323 0.00 .5000 .5000
12.8 0.06 .5239 .4761
12.4 0.85 .8023 .1977
12.0001 1.645 .9500 .0500
When the true population mean is close to the null hypothesis value of 12, there is a high probability
that we will make a Type II error.
64
Power of the Test
The probability of correctly rejecting H0 when it is false is called the power of the test.
For any particular value of , the power is 1 – b.
We can show graphically the power associated with each value of ; such a graph is called a
power curve.
65
Power of the Test
1.00
Probability of Correctly
0.80
H0 False
0.70
0.60
0.50
0.40
0.30
0.20
0.10
0.00
11.5 12.0 12.5 13.0 13.5 14.0 14.5
66
Determining the Sample Size for a Hypothesis Test
About a Population Mean
The specified level of significance determines the maximum probability of making a Type I
error.
By controlling the sample size, the probability of making a Type II error is controlled.
67
Determining the Sample Size for a Hypothesis Test
About a Population Mean
Sampling
distribution c
of 𝑥ҧ when H0:
H0 is true Reject H0
Ha:
and = 0
x
0 Sampling
distribution
of 𝑥ҧ when
H0 is false
Note:
and a > 0
b
x
c a 68
Determining the Sample Size for a Hypothesis Test
About a Population Mean
( z + zb ) 2 s 2
n=
( 0 − a )2
where
z = z value providing an area of in the tail
zb = z value providing an area of b in the tail
s = population standard deviation
0 = value of the population mean in H0
a = value of the population mean used for the
Type II error
Note: In a two-tailed hypothesis test, use z /2 not z
69
Determining the Sample Size for a Hypothesis Test
About a Population Mean
Let’s assume that the director of medical services makes the following statements about the
allowable probabilities for the Type I and Type II errors:
If the mean response time is = 12 minutes, I am willing to risk an = .05 probability of rejecting
H0.
If the mean response time is 0.75 minutes over the specification ( = 12.75), I am willing to risk a b
= .10 probability of not rejecting H0.
= .05, b = .10
z = 1.645, zb = 1.28
0 = 12, a = 12.75
s = 3.2
( z + zb )2s 2(1.645 + 1.28)2 (3.2)2
n= = = 155.75 156
( 0 − a ) 2
(12 − 12.75) 2
70
Relationship Among , b, and n
Once two of the three values are known, the other can be computed.
For a given level of significance , increasing the sample size n will reduce b.
For a given sample size n, decreasing will increase b, whereas increasing will decrease b.
71
Thank You !!!