Title: Chapter 2 Tests of Hypotheses for a Single Sample
1Chapter 2 Tests of Hypotheses for a Single Sample
2Agenda
- Hypothesis testing
- Inference on the mean (variance known)
- Inference on the mean (variance unknown)
- Inference on the variance
- Inference on the proportion
- Goodness-of-fit test
- Contingency table tests
3Hypothesis Testing Statistical Hypotheses
Statistical hypothesis testing and confidence
interval estimation of parameters are the
fundamental methods used at the data analysis
stage of a , in which the engineer is
interested, for example, in comparing the mean of
a population to a specified value.
Definition
4Hypothesis Testing Statistical Hypotheses
- For example, suppose that we are interested in
the burning rate of a solid propellant used to
power aircrew escape systems. - Now burning rate is a random variable that can
be described by a probability distribution. - Suppose that our interest focuses on the
burning rate (a parameter of this distribution). - Specifically, we are interested in deciding
whether or not the mean burning rate is 50
centimeters per second.
5Hypothesis Testing Statistical Hypotheses
Two-sided Alternative Hypothesis
null hypothesis
alternative hypothesis
One-sided Alternative Hypotheses
6Hypothesis Testing Statistical Hypotheses
- Test of a Hypothesis
- A procedure leading to a decision about a
particular hypothesis - Hypothesis-testing procedures rely on using the
information in a . - If this information is consistent with the
hypothesis, then we will conclude that the
hypothesis is if this information is
inconsistent with the hypothesis, we will
conclude that the hypothesis is .
7Hypothesis Testing Tests of Statistical
Hypotheses
Decision criteria for testing H0? 50
centimeters per second versus H1? ? 50
centimeters per second.
8Hypothesis Testing Tests of Statistical
Hypotheses
Definitions
9Hypothesis Testing Tests of Statistical
Hypotheses
Sometimes the type I error probability is called
the , or the , or the of the test.
10Hypothesis Testing Tests of Statistical
Hypotheses
11Hypothesis Testing Tests of Statistical
Hypotheses
Fig. 1. The critical region for H0 µ 50 versus
H1 µ ? 50 and n 10
12Hypothesis Testing
Fig. 2. The probability of type II error when ?
52 and n 10.
13Hypothesis Testing
14Hypothesis Testing
Fig. 3. The probability of type II error when ?
50.5 and n 10.
15Hypothesis Testing
16Hypothesis Testing
Fig. 4. The probability of type II error when ?
2 and n 16.
17Hypothesis Testing
18Hypothesis Testing
19Hypothesis Testing
Definition
- The power is computed as 1 - ?, and power can
be interpreted as . We often compare
statistical tests by comparing their power
properties. - For example, consider the propellant burning
rate problem when - we are testing H 0 µ 50 centimeters per
second against H 1 µ not equal 50 centimeters
per second . Suppose that the true value of the
mean is µ 52. When n 10, we found that ?
0.2643, so the power of this test is 1 - ? 1 -
0.2643 0.7357 when µ 52.
20Hypothesis Testing One-Sided and Two-Sided
Hypotheses
Two-Sided Test
One-Sided Tests
21Example 1
22Hypothesis Testing
The bottler wants to be sure that the bottles
meet the specification on mean internal pressure
or bursting strength, which for 10-ounce bottles
is a minimum strength of 200 psi. The bottler has
decided to formulate the decision procedure for a
specific lot of bottles as a hypothesis testing
problem. There are two possible formulations for
this problem, either
or
23Hypothesis Testing General Procedure
1. From the problem context, identify the
parameter of interest. 2. State the null
hypothesis, H0 . 3. Specify an appropriate
alternative hypothesis, H1. 4. Choose a
significance level, ?. 5. Determine an
appropriate test statistic. 6. State the
rejection region for the statistic. 7. Compute
any necessary sample quantities, substitute these
into the equation for the test statistic, and
compute that value. 8. Decide whether or not H0
should be rejected and report that in the problem
context.
24Tests on the Mean of a Normal Distribution,
Variance Known
1. Hypothesis Tests on the Mean
We wish to test
The is
25Tests on the Mean of a Normal Distribution,
Variance Known
1. Hypothesis Tests on the Mean
Reject H0 if the observed value of the test
statistic z0 is either z0 gt z?/2 or z0 lt
-z?/2 Fail to reject H0 if -z?/2 lt
z0 lt z?/2
26Tests on the Mean of a Normal Distribution,
Variance Known
Fig. 5. The distribution of Z0 when H0 µ µ0
is true, with critical region for (a) the
two-sided alternative H1 µ ? µ 0, (b) the
one-sided alternative H1 µ gt µ 0, and (c)
the one-sided alternative H1 µ lt µ0.
27Example 2
28Example 2
29Example 2
301. Hypothesis Tests on the Mean
- We may also develop procedures for testing
hypotheses on the mean where the mean µ
alternative hypothesis is one-sided. Suppose that
we specify the hypotheses as - H0 µ µ0
- H1 µ gt µ0 (a)
- In defining the critical region for this test, we
observe that a negative value of the test
statistic Z0 would never lead us to conclude that
H0 µ µ0 is false. Therefore, we would place
the critical region in the of the standard
normal distribution and reject H0 if the computed
value of z0 is too large. That is, we would
reject H0 if (Fig. 5b) - Z0 gt Z? (b)
- Similarly, to test
- H0 µ µ0
- H1 µ lt µ0 (c)
- we would calculate the test statistic Z0 and
reject H0 if the value of Z0 is too small. That
is, the critical region is in the of the
standard normal distribution as shown in Fig. 5c,
and we reject H0 if - Z0 lt - Z? (d)
31Tests on the Mean of a Normal Distribution,
Variance Known
2. P-Values in Hypothesis Tests Definition
32Tests on the Mean of a Normal Distribution,
Variance Known
3. Connection between Hypothesis Tests and
Confidence Intervals
33Tests on the Mean of a Normal Distribution,
Variance Known
4. Type II Error and Choice of Sample
Size Finding the Probability of Type II Error ?
34Tests on the Mean of a Normal Distribution,
Variance Known
4. Type II Error and Choice of Sample
Size Finding the Probability of Type II Error ?
35Tests on the Mean of a Normal Distribution,
Variance Known
4. Type II Error and Choice of Sample
Size Finding the Probability of Type II Error ?
Fig. 6. The distribution of Z0 under H0 and H1
36Tests on the Mean of a Normal Distribution,
Variance Known
4. Type II Error and Choice of Sample Size Sample
Size Formulas For a two-sided alternative
hypothesis
37Tests on the Mean of a Normal Distribution,
Variance Known
4. Type II Error and Choice of Sample Size Sample
Size Formulas For a one-sided alternative
hypothesis
38Example 3
2
39Minitab Practice for Example 3
- Output sample size n ?
- Menu ?Stat ? ?1 Sample ?
- Differences 1
- Power values 0.9
- Sigma 2
- Options ? Significant level 0.05
- If Power values 0.75, n ?
40Tests on the Mean of a Normal Distribution,
Variance Known
4. Type II Error and Choice of Sample Size Using
Operating Characteristic Curves
41Tests on the Mean of a Normal Distribution,
Variance Known
4. Type II Error and Choice of Sample Size Using
Operating Characteristic Curves
- So one set of operating characteristic curves
can be used for all problems regardless of the
values of µ0 and ?. From examining the operating
characteristic curves or Equation 9-17 and Fig.
6, we note that - The further the true value of the mean µ is from
µ0, the smaller the probability of type II error
? for a given n and ?. That is, we see that for a
specified sample size and ?, large differences in
the mean are easier to detect than small ones. - For a given d and ?, the probability of type II
error ? decreases as n increases. That is, to
detect a specified difference d in the mean, we
may make the test more powerful by increasing the
sample size.
42Example 4
2
43Minitab Practice for Example 4
- Output power values ?
- Menu ?Stat ?Power and Sample Size ?1 Sample Z
Test ? - Differences 1
- Sample sizes 25
- Sigma 2
- Options ? Significant level 0.05
44Tests on the Mean of a Normal Distribution,
Variance Known
5. Some Practical Comments on Hypothesis
Tests Statistical versus Practical Significance
45Tests on the Mean of a Normal Distribution,
Variance Unknown
1. Hypothesis Tests on the Mean One-Sample t-Test
46Tests on the Mean of a Normal Distribution,
Variance Unknown
1. Hypothesis Tests on the Mean
Fig. 7. The reference distribution for H0 ? ?0
with critical region for (a) H1 ? ? ?0 ,
(b) H1 ? gt ?0, and (c) H1 ? lt ?0.
47Example 5
48Example 5
8
49Example 5
Fig. 8. Normal probability plot of the
coefficient of restitution data
50Example 5
51Minitab Practice for Example 5
- Data file Example 2_5.xls
- Menu ? Stat ? ?1 Sample ? select variable
- Test mean 0.82
- Options ? Alternative
52Tests on the Mean of a Normal Distribution,
Variance Unknown
2. P-value for a t-Test
The P-value for a t-test is just the smallest
level of significance at which the null
hypothesis would be rejected.
5
Notice that t0 2.72 in Example 5, and that
this is between two tabulated values, 2.624 and
2.977. Therefore, the P-value must be between
0.01 and 0.005. These are effectively the upper
and lower bounds on the P-value.
53Tests on the Mean of a Normal Distribution,
Variance Unknown
3. Choice of Sample Size
The type II error of the two-sided alternative
(for example) would be
54Example 6
5
55Minitab Practice for Example 6
- Output power values ?
- Menu ?Stat ? ?1 Sample ?
- Differences 0.02
- Sample sizes 15
- Sigma 0.02456
- Options ? Alternative
- Significant level 0.05
- Output power values ? If Differences 0.01
- Output n ? Differences 0.01 Power values
0.8
56Hypothesis Tests on the Variance and Standard
Deviation of a Normal Distribution
1. The Hypothesis Testing Procedure
57Hypothesis Tests on the Variance and Standard
Deviation of a Normal Distribution
1. The Hypothesis Testing Procedure
58Hypothesis Tests on the Variance and Standard
Deviation of a Normal Distribution
1. The Hypothesis Testing Procedure
9b and 9c
59Hypothesis Tests on the Variance and Standard
Deviation of a Normal Distribution
1. The Hypothesis Testing Procedure
Fig. 9. Reference distribution for the test of
H0 ?2 ?02 with critical region values for
(a) H0 ?2 ? ?02, (b) H1 ?2 gt ?02, and
(c) H1 ?2 lt ?02
60Example 7
61Example 7
62Hypothesis Tests on the Variance and Standard
Deviation of a Normal Distribution
2. ?-Error and Choice of Sample Size
For the two-sided alternative hypothesis
Operating characteristic curves are provided in
Charts VIi and VIj
63Example 8
64Tests on a Population Proportion
1. Large-Sample Tests on a Proportion
Many engineering decision problems include
hypothesis testing about p.
An appropriate is
65Example 9
66Example 9
67Minitab Practice for Example 9
- Menu ? Stat ? ?1 proportion ? select
- Number of trials 200
- Number of Success 4
- ? Select Options
- Confident level 95
- Test proportion 0.05
- Alternative
- Check
68Tests on a Population Proportion
Another form of the test statistic Z0 is
or
69Tests on a Population Proportion
2. Type II Error and Choice of Sample Size
For a two-sided alternative
If the alternative is p lt p0
If the alternative is p gt p0
70Tests on a Population Proportion
2. Type II Error and Choice of Sample Size
For a two-sided alternative
For a one-sided alternative
71Example 10
72Example 10
73Minitab Practice for Example 10
- Output power values ?
- Menu ?Stat ? ?1 proportion
- Sample sizes 200
- Alternative value of p 0.03
- Hypothesized p 0.05
- Options ? Alternative
- Significant level 0.05
- Output n ? p 0.03 Power values 0.9
- Output n ? p 0.03 Power values 0.75
74Testing for Goodness of Fit
- The test is based on the chi-square
distribution. - Assume there is a sample of size n from a
population whose probability distribution is
unknown. - Let Oi be the observed frequency in the ith
class interval. - Let Ei be the expected frequency in the ith
class interval. - The test statistic is
75Example 11
76Example 11
77Example 11
78Example 11
79Example 11
80Example 11
81Contingency Table Tests
Many times, the n elements of a sample from a
population may be classified according to two
different criteria. It is then of interest to
know whether the two methods of classification
are statistically independent
82Contingency Table Tests
83Contingency Table Tests
84Example 12
85Example 12
86Example 12
87Example 12