Uploaded by sheena mittal

Goodness of fit

advertisement
Applied Statistics and Probability for
Engineers
Sixth Edition
Douglas C. Montgomery
George C. Runger
Chapter 9
Tests of Hypotheses for a Single Sample
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
9
Tests of Hypotheses
for a Single Sample
CHAPTER OUTLINE
9-1 Hypothesis Testing
9-1.1 Statistical Hypotheses
9-1.2 Tests of Statistical Hypotheses
9-1.3 1-Sided & 2-Sided Hypotheses
9-1.4 P-Values in Hypothesis Tests
9-1.5 Connection between Hypothesis
Tests & Confidence Intervals
9-1.6 General Procedure for
Hypothesis Tests
9-2 Tests on the Mean of a Normal
Distribution, Variance Known
9-2.1 Hypothesis Tests on the Mean
9-2.2 Type II Error & Choice of Sample Size
9-2.3 Large-Sample Test
9-3 Tests on the Mean of a Normal
Distribution, Variance Unknown
9-3.1 Hypothesis Tests on the Mean
9-3.2 Type II Error & Choice of Sample Size
9-4 Tests of the Variance & Standard
Deviation of a Normal Distribution.
9-4.1 Hypothesis Tests on the Variance
9-4.2 Type II Error & Choice of Sample Size
9-5 Tests on a Population Proportion
9-5.1 Large-Sample Tests on a Proportion
9-5.2 Type II Error & Choice of Sample Size
9-6 Summary Table of Inference Procedures
for a Single Sample
9-7 Testing for Goodness of Fit
9-8 Contingency Table Tests
9-9 Non-Parametric Procedures
9-9.1 The Sign Test
9-9.2 The Wilcoxon Signed-Rank Test
9-9.3 Comparison to the t-test
2
Chapter 9 Title and Outline
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
9-1 Hypothesis Testing
9-1.6 General Procedure for Hypothesis Tests
1. Identify the parameter of interest.
2. Formulate 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 criteria for the statistic.
7. Compute necessary sample quantities for calculating the test statistic.
8. Draw appropriate conclusions.
3
Sec 9-1 Hypothesis Testing
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
9-7 Testing 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
X 02
(Oi  Ei ) 2

Ei
i 1
k
(9-16)
Sec 9-7 Testing for Goodness of Fit
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
4
9-7 Testing for Goodness of Fit
EXAMPLE 9-12 Printed Circuit Board Defects
Poisson Distribution
The number of defects in printed circuit boards is hypothesized to follow a
Poisson distribution. A random sample of n = 60 printed boards has been
collected, and the following number of defects observed.
Number of
Defects
0
1
2
3
Observed
Frequency
32
15
9
4
Sec 9-7 Testing for Goodness of Fit
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
5
9-7 Testing for Goodness of Fit
Example 9-12
The mean of the assumed Poisson distribution in this example is unknown and
must be estimated from the sample data. The estimate of the mean number of
defects per board is the sample average, that is, (32·0 + 15·1 + 9·2 + 4·3)/60 =
0.75. From the Poisson distribution with parameter 0.75, we may compute pi, the
theoretical, hypothesized probability associated with the ith class interval. Since
each class interval corresponds to a particular number of defects, we may find the
pi as follows:
e 0.75 0.750
p1  P ( X  0) 
 0.472
0!
e 0.75 0.751
p 2  P ( X  1) 
 0.354
1!
e 0.75 0.752
p3  P ( X  2) 
 0.133
2!
p 4  P ( X  3)  1   p1  p 2  p3   0.041
Sec 9-7 Testing for Goodness of Fit
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
6
9-7 Testing for Goodness of Fit
Example 9-12
The expected frequencies are computed by multiplying the sample size n = 60
times the probabilities pi. That is, Ei = npi. The expected frequencies follow:
Number of Defects
0
1
2
3 (or more)
Probability
0.472
0.354
0.133
0.041
Expected
Frequency
28.32
21.24
7.98
2.46
Sec 9-7 Testing for Goodness of Fit
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
7
9-7 Testing for Goodness of Fit
Example 9-12
Since the expected frequency in the last cell is less than 3, we combine the
last two cells:
Number of
Defects
0
Observed
Frequency
32
Expected
Frequency
28.32
1
2 (or more)
15
13
21.24
10.44
The chi-square test statistic in Equation 9-16 will have k p  1 = 3 1  1 = 1
degree of freedom, because the mean of the Poisson distribution was
estimated from the data.
Sec 9-7 Testing for Goodness of Fit
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
8
9-7 Testing for Goodness of Fit
Example 9-12
The eight-step hypothesis-testing procedure may now be applied, using
 = 0.05, as follows:
1. Parameter of interest: The variable of interest is the form of the distribution
of defects in printed circuit boards.
2. Null hypothesis: H0: The form of the distribution of defects is Poisson.
3. Alternative hypothesis: H1: The form of the distribution of defects is not
Poisson.
4.  = 0.05
5. Test statistic: The test statistic is
 
k

i 1
oi
 Ei 2
Ei
Sec 9-7 Testing for Goodness of Fit
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
9
9-7 Testing for Goodness of Fit
Example 9-12
6. Reject H0 if: Reject H0 if the P-value is less than 0.05.
7. Computations:
 

32  28.322
28.32


13  10.442
10.44
15  21.242
21.24
 2.94
2
8. Conclusions: We find from Appendix Table III that    2.71 and
2
 
 3.84 . Because    2.94 lies between these values, we conclude
that the P-value is between 0.05 and 0.10. Therefore, since the P-value
exceeds 0.05 we are unable to reject the null hypothesis that the distribution
of defects in printed circuit boards is Poisson. The exact P-value computed
from Minitab is 0.0864.
Sec 9-7 Testing for Goodness of Fit
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
10
9-9 Nonparametric Procedures
9-9.1 The Sign Test
• The sign test is used to test hypotheses about the median
• Suppose that the hypotheses are
H 0 :   0
𝜇෤
of a continuous distribution.
H1 :   0
• Test procedure: Let X1, X2,... ,Xn be a random sample from the population of interest.
Form the differences X i  0 , i =1,2,…,n.
• An appropriate test statistic is the number of these differences that are positive, say R +.
• P-value for the observed number of plus signs r+ can be calculated directly from the
binomial distribution.
• If the computed P-value is less than or equal to the significance level α, we will reject H0 .
• For two-sided alternative H 0 :   0
H1 :   0
• If the computed P-value is less than the significance level α, we will reject H0 .
Sec 9-9 Nonparametric Procedures
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
11
EXAMPLE 9-15 Propellant Shear Strength Sign Test
Montgomery, Peck, and Vining (2012) reported on a study in which a rocket motor is
formed by binding an igniter propellant and a sustainer propellant together inside a metal
housing. The shear strength of the bond between the two propellant types is an important
characteristic. The results of testing 20 randomly selected motors are shown in Table 9-5.
Test the hypothesis that the median shear strength is 2000 psi, using α = 0.05.
Table 9-5 Propellant Shear Strength Data
Shear
Observation
Differences
Strength
Sign
i
xi - 2000
xi
1
2158.70
158.70
+
2
1678.15
–321.85
–
3
2316.00
316.00
+
4
2061.30
61.30
+
5
2207.50
207.50
+
6
1708.30
–291.70
–
7
1784.70
–215.30
–
8
2575.10
575.10
+
9
2357.90
357.90
+
10
2256.70
256.70
+
11
2165.20
165.20
+
12
2399.55
399.55
+
13
1779.80
–220.20
–
14
2336.75
336.75
+
15
1765.30
–234.70
–
16
2053.50
53.50
+
17
2414.40
414.40
+
18
2200.50
200.50
+
19
2654.20
654.20
+
20
1753.70
–246.30
–
Sec 9-9 Nonparametric Procedures
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
12
EXAMPLE 9-15 Propellant Shear Strength Sign Test - Continued
The eight-step hypothesis-testing procedure is:
1. Parameter of Interest: The variable of interest is the median of the distribution
of propellant shear strength.
2. Null hypothesis: H 0 :   2000 psi
3. Alternative hypothesis: H1 :   2000 psi
4. α= 0.05
5. Test statistic: The test statistic is the observed number of plus differences in
Table 9-5, i.e., r+ = 14.
6. Reject H0 : If the P-value corresponding to r+ = 14 is less than or equal to
α= 0.05
7. Computations : r+ = 14 is greater than n/2 = 20/2 = 10.
1

P-value :
P  2 P  R  14 when p 



20
 20 
r
 2 
  0.5 
r 14  r

 0.1153
2
 0.5 
20  r
8. Conclusions: Since the P-value is greater than α= 0.05 we cannot reject
the null hypotheses that the median shear strength is 2000 psi.
Sec 9-9 Nonparametric Procedures
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
13
9-9 Nonparametric Procedures
9-9.2 The Wilcoxon Signed-Rank Test
• A test procedure that uses both direction (sign) and magnitude.
• Suppose that the hypotheses are
H 0 :   0
H1 :   0
Test procedure : Let X1, X2,... ,Xn be a random sample from continuous and symmetric
distribution with mean (and Median) μ. Form the differences X i  0 .
• Rank the absolute differences X i  0 in ascending order, and give the ranks
to the signs of their corresponding differences.
• Let W+ be the sum of the positive ranks and W– be the absolute value of the sum of the
negative ranks, and let W = min(W+, W−).
Critical values of W, can be found in Appendix Table IX.
• If the computed value is less than the critical value, we will reject H0 .
• For one-sided alternatives H1 :   0
H1 :   0
reject H0 if W– ≤ critical value
reject H0 if W+ ≤ critical value
Sec 9-9 Nonparametric Procedures
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
14
Sec 9-
15
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
EXAMPLE 9-16 Propellant Shear Strength-Wilcoxon Signed-Rank Test
Let’s illustrate the Wilcoxon signed rank test by applying it to the propellant shear strength
data from Table 9-5. Assume that the underlying distribution is a continuous symmetric
distribution. Test the hypothesis that the mean shear strength is 2000 psi, using
α = 0.05.
The eight-step hypothesis-testing procedure is:
1. Parameter of Interest: The variable of interest is the mean or median of the
distribution of propellant shear strength.
2. Null hypothesis: H 0 :   2000 psi
3. Alternative hypothesis: H1 :   2000 psi
4. α = 0.05
5. Test statistic: The test statistic is W = min(W+, W−)
6. Reject H0 if: W ≤ 52 (from Appendix Table IX).
7. Computations : The sum of the positive ranks is
w+ = (1 + 2 + 3 + 4 + 5 + 6 + 11 + 13 + 15 + 16 + 17 + 18 + 19 + 20) = 150, and the
sum of the absolute values of the negative ranks is
w- = (7 + 8 + 9 + 10 + 12 + 14) = 60.
Sec 9-9 Nonparametric Procedures
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
16
EXAMPLE 9-16 Propellant Shear Strength-Wilcoxon Signed-Rank Test
Observation
i
Differences
xi - 2000
16
53.50
4
1
11
18
5
7
13
15
20
10
6
3
2
14
9
12
17
8
19
61.30
158.70
165.20
200.50
207.50
–215.30
–220.20
–234.70
–246.30
256.70
–291.70
316.00
–321.85
336.75
357.90
399.55
414.40
575.10
654.20
Signed Rank
1
2
3
4
5
6
–7
–8
–9
–10
11
–12
13
–14
15
16
17
18
19
20
W = min(W+, W−) = min(150 , 60) = 60
7. Conclusions: Since W = 60 is not ≤ 52 we fail to reject the null hypotheses that the
mean or median shear strength is 2000 psi.
Sec 9-9 Nonparametric Procedures
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
17
Download