Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Statistics Tests of Hypotheses for a Single Sample Contents, figures, and exercises come from the textbook: Applied Statistics and Probability for Engineers, 5th Edition, by Douglas C. Montgomery, John Wiley & Sons, Inc., 2011. Hypothesis Testing Statistical hypothesis A statistical hypothesis is a statement about the parameters of one or more populations. For example, H 0 : 50 centimeters per second H1 : 50 centimeters per second H 0 is the null hypothesis and H1 is a twosided alternative hypothesis Type I error Type II error Failing to reject the null hypothesis when it is false is defined as a type II error Probability of type I error Rejecting the null hypothesis H 0 when it is true is defined as a type I error = P(type I error) = P(reject H 0 when H 0 is true) Probability of type II error = P(type II error) = P(fail to reject H 0 when H 0 is false) Contents, figures, and exercises come from the textbook: Applied Statistics and Probability for Engineers, 5th Edition, by Douglas C. Montgomery, John Wiley & Sons, Inc., 2011. Reject null hypothesis Fail to reject null hypothesis Null hypothesis (H0) is true Null hypothesis (H0) is false Type I error False positive Correct outcome True positive Correct outcome True negative Type II error False negative From Wikipedia, http://www.wikipedia.org. Properties The size of the critical region and can be reduced by appropriate selection of the critical values Type I and type II errors are related. Decrease one will increase the other An increase in sample size reduces increases as the true value of the parameter approaches the value hypothesized in the null hypothesis = 0.05 Widely used Contents, figures, and exercises come from the textbook: Applied Statistics and Probability for Engineers, 5th Edition, by Douglas C. Montgomery, John Wiley & Sons, Inc., 2011. Power 1 The probability of correctly rejecting a false null hypothesis Sensitivity: the ability to detect differences Contents, figures, and exercises come from the textbook: Applied Statistics and Probability for Engineers, 5th Edition, by Douglas C. Montgomery, John Wiley & Sons, Inc., 2011. Formulating one-sided hypothesis : = 1.5 MPa H1 : > 1.5 Mpa (We want) Or H 0 : = 1.5 MPa H1 : < 1.5 Mpa (We want) H0 Contents, figures, and exercises come from the textbook: Applied Statistics and Probability for Engineers, 5th Edition, by Douglas C. Montgomery, John Wiley & Sons, Inc., 2011. Formulating one-sided hypothesis : = 1.5 MPa H1 : > 1.5 Mpa (We want) Or H 0 : = 1.5 MPa H1 : < 1.5 Mpa (We want) H0 P-value The P-value is the smallest level of significance that would lead to rejection of the null hypothesis H 0 with the given data Contents, figures, and exercises come from the textbook: Applied Statistics and Probability for Engineers, 5th Edition, by Douglas C. Montgomery, John Wiley & Sons, Inc., 2011. General procedure for hypothesis tests Specify the test statistic to be used (such as Z 0 ) Specify the location of the critical region (twotailed, upper-tailed, or lower-tailed) Specify the criteria for rejection (typically, the value of , or the P-value at which rejection should occur) Practical significance Be careful when interpreting the results from hypothesis testing when the sample size is large, because any small departure from the hypothesized value 0 will probably be detected, even when the difference is of little or no practical significance Contents, figures, and exercises come from the textbook: Applied Statistics and Probability for Engineers, 5th Edition, by Douglas C. Montgomery, John Wiley & Sons, Inc., 2011. Example 9-1 Propellant Burning Rate Suppose that if the burning rate is less than 50 centimeters per second, we wish to show this with a strong conclusion. H 0 : 50 centimeters per second H1 : 50 centimeters per second Since the rejection of H 0 is always a strong conclusion, this statement of the hypotheses will produce outcome if H 0 is rejected. Contents, figures, and exercises come from the textbook: Applied Statistics and Probability for Engineers, 5th Edition, by Douglas C. Montgomery, John Wiley & Sons, Inc., 2011. Exercise 9-27 A random sample of 500 registered voters in Phoenix is asked if they favor the use of oxygenated fuels year-round to reduce air pollution. If more than 400 voters respond positively, we will conclude that more than 60% of the voters favor the use of these fuels. (a) Find the probability of type I error if exactly 60% of the voters favor the use of these fuels. (b) What is the type II error probability if 75% of the voters favor this action? Hint: use the normal approximation to the binomial. Contents, figures, and exercises come from the textbook: Applied Statistics and Probability for Engineers, 5th Edition, by Douglas C. Montgomery, John Wiley & Sons, Inc., 2011. Tests on the Mean of a Normal Distribution,Variance Known Hypothesis tests on the mean Hypotheses, two-sided alternative H 0 : 0 H1 : 0 x 0 Test statistic: z0 / n P-value: P 2[1 (| z0 |)] Reject H 0 if z0 z / 2 or z0 z / 2 Hypotheses, upper-tailed alternative H 0 : 0 H1 : 0 P-value: P 1 ( z0 ) Reject H 0 if z0 z Hypotheses, lower-tailed alternative H 0 : 0 H1 : 0 P-value: P ( z0 ) Reject H 0 if z0 z Type II error and choice of sample size Finding the probability of type II error Hypotheses, two-sided alternative H 0 : 0 H1 : 0 Suppose the true value of the mean under H1 is 0 Test statistic: x 0 x ( 0 ) n z0 / n / n Under H1 n z0 N ,1 n n z / 2 z / 2 Type II error and choice of sample size Sample size formulas If 0 n n z / 2 z / 2 n z / 2 Let z be the 100 upper percentile of the standard normal distribution. Then ( z ) z z / 2 n Note n n z / 2 z / 2 n n 1 z / 2 1 z / 2 n n z / 2 z / 2 Sample size for a two-sided test on the mean, variance known n ( z / 2 z ) 2 2 2 where 0 Sample size for a one-sided test on the mean, variance known n ( z z ) 2 2 2 where 0 Operating characteristic (OC) curves Curves plotting against a parameter d for various sample size n | 0 | d See Appendix VII For a given n and d , find . For a given and d , find n Large-sample test If n 40 , the sample standard deviation s can be substituted for in the test procedures with little effect Example 9-2 Propellant Burning Rate 2 , 0.05 , n 25 , x 51.3 , Specifications require that the mean burning rate must be 50 centimeters per second. What conclusions should be drawn? Example 9-3 Propellant Burning Rate Type II Error Suppose that the true burning rate is 49 centimeters per second. What is for the twosided test with 0.05 , 2 , and n 25 ? Example 9-4 Propellant Burning Rate Type II Error from OC Curve Suppose the true mean burning rate is 51 centimeters per second. | 0 | | | 1 d 2 Example 9-4 Propellant Burning Rate Sample Size from OC Curve Design the test so that if the true mean burning rate differs from 50 centimeters per second by as much an 1 centimeter per second, the test will detect this with a high probability 0.90. 1 0.90 Exercise 9-47 Medical researchers have developed a new artificial heart constructed primarily of titanium and plastic. The heart will last and operate almost indefinitely once it is implanted in the patient’s body, but the battery pack needs to be recharged about every four hours. A random sample of 50 battery packs is selected and subjected to a life test. The average life of these batteries is 4.05 hours. Assume that battery life is normally distributed with standard deviation 0.2 hour. (a) Is there evidence to support the claim that mean battery life exceeds 4 hours? Use 0.05 . (b) What is the P-value for the test in part (a)? Exercise 9-47 (c) Compute the power of the test if the true mean battery life is 4.05 hours. (d) What sample size would be required to detect a true mean battery life of 4.5 hours if we wanted the power of the test to be at least 0.9? (e) Explain how the question in part (a) could be answered by constructing a one-sided confidence bound on the mean life. Tests on the Mean of a Normal Distribution,Variance Unknown Hypothesis tests on the mean Hypotheses, two-sided alternative H 0 : 0 H1 : 0 x 0 Test statistic: T0 S/ n P-value: P 2P(Tn1 | t0 |) Reject H 0 if t0 t / 2,n 1 or t0 t / 2,n 1 Hypotheses, upper-tailed alternative H 0 : 0 H1 : 0 P-value: P P(Tn 1 t0 ) Reject H 0 if t0 t , n 1 Hypotheses, lower-tailed alternative H 0 : 0 H1 : 0 P-value: P P(Tn1 t0 ) Reject H 0 if t0 t ,n 1 Type II error and choice of sample size Finding the probability of type II error Hypotheses, two-sided alternative H 0 : 0 H1 : 0 Suppose the true value of the mean under H1 is 0 Test statistic: x 0 t0 S/ n n ( x ( 0 )) (n 1) S 2 1 2 n 1 n Under H1 t 0 is of the noncentral t distribution with degrees of freedom and noncentrality n / parameter . PDF of noncentral t distribution From Wikipedia, http://www.wikipedia.org. Type II error and choice of sample size Finding the probability of type II error Hypotheses, two-sided alternative P{t / 2,n1 T0 t / 2,n1 | 0} P{t / 2,n1 T0 ' t / 2,n1} where T0 ' denotes the noncentral t random variable Operating characteristic (OC) curves Curves plotting against a parameter d for various sample size n | 0 | d See Appendix VII Note that d depends on the unknown parameter 2 Example 9-6 Golf Club Design n 15 It is of interest to determine if there is evidence (with 0.05) to support a claim that the mean coefficient of restitution exceeds 0.82. Data: 0.8411, … x 0.83725 and s 0.02456 Example 9-7 Golf Club Design Sample Size If the mean coefficient of restitution exceeds 0.82 by as much as 0.02, is the sample size n 15 adequately to ensure that H 0 : 0.82 will be rejected with probability at least 0.8? Exercise 9-59 A 1992 article in the Journal of the American Medical Association (“A Critical Appraisal of 98.6 Degrees F, the Upper Limit of the Normal Body Temperature, and Other Legacies of Carl Reinhold August Wunderlich”) reported body temperature, gender, and heart rate for a number of subjects. The body temperatures for 25 female subjects follow: 97.8, … (a) Test the hypothesis H 0 : 98.6 versus H1 : 98.6 using 0.05 . Find the P-value. (b) Check the assumption that female body temperature is normally distributed. (c) Compute the power of the test if the true mean female body temperature is as low as 98.0. Exercise 9-59 (d) What sample size would be required to detect a true mean female body temperature as low as 98.2 if we wanted the power of the test to be at least 0.9? (e) Explain how the question in part (a) could be answered by constructing a two-sided confidence interval on the mean female body temperature. Exercise 9-59 Normality plot Tests on the Variance and Standard Deviation of a Normal Distribution Hypothesis tests on the variance Hypotheses, two-sided alternative H 0 : 2 02 H1 : 2 02 2 ( n 1 ) S Test statistic: X 02 02 P-value: P P( X n21 2 / 2,n1 ) P( X n21 12 / 2,n1 ) Reject H 0 if 02 2 / 2,n1 or 02 12 / 2,n1 Hypotheses, upper-tailed alternative H 0 : 2 02 H 1 : 2 02 P-value: P P( X n21 2,n1 ) Reject H 0 if 02 2,n1 Hypotheses, lower-tailed alternative H 0 : 2 02 H 1 : 2 02 P-value: P P( X n21 12 ,n1 ) Reject H 0 if 02 12 ,n1 Type II error and choice of sample size Finding the probability of type II error Hypotheses, two-sided alternative H 0 : 2 02 H1 : 2 02 Suppose the true value of the variance under H1 is 2 (n 1) s 2 2 2 P{1 / 2,n 1 / 2 , n 1 | H 1} 2 0 02 2 (n 1) s 2 02 2 P{ 2 1 / 2,n 1 2 / 2,n 1 | H1} 2 Type II error and choice of sample size Finding the probability of type II error Hypotheses, upper-tailed alternative H 0 : 2 02 H 1 : 2 02 Suppose the true value of the variance under H1 is 2 (n 1) s 2 2 P{ , n 1 | H 1} 2 0 P{ (n 1) s 2 2 02 2 2 ,n 1 | H1} Type II error and choice of sample size Finding the probability of type II error Hypotheses, lower-tailed alternative H 0 : 2 02 H 1 : 2 02 Suppose the true value of the variance under H1 is 2 (n 1) s 2 2 P{1 ,n 1 | H 1} 2 0 02 2 (n 1) s 2 P{ 2 1 ,n 1 | H 1} 2 Type II error and choice of sample size Finding the probability of type II error Hypotheses, two-sided alternative Operating characteristic (OC) curves Curves plotting against a parameter for various sample size n 0 See Appendix VII Example 9-8 Automated Filling n 20 , s 2 0.0153 , 0.05. Is there evidence in the sample data to suggest that the manufacture has a problem with underfilled or overfilled bottles? ( 2 0.01 ) Example 9-8 Automated Filling Sample Size 0 0.10 , 0.125 Find Exercise 9-83 Recall the sugar content of the syrup in canned peaches from Exercise 8-46. Suppose that the variance is thought to be 2 18 (milligrams)2. Recall that a random sample of n 10 cans yields a sample standard deviation of s 4.8 milligrams. 2 (a) Test the hypothesis H 0 : 18 versus H1 : 2 18 using 0.05 . Find the P-value for this test. (b) Suppose that the actual standard deviation is twice as large as the hypothesized value. What is the probability that this difference will be detected by the test described in part (a)? 2 (c) Suppose that the true variance is 40 . How large a sample would be required to detect this difference with probability at least 0.90? Tests on a Population Proportion Large-sample tests on a proportion Hypotheses, two-sided alternative H 0 : p p0 H1 : p p0 X np0 z Test statistic: 0 np0 (1 p0 ) P-value: P 2[1 (| z0 |)] Reject H 0 if z0 z / 2 or z0 z / 2 Hypotheses, upper-tailed alternative H 0 : p p0 H1 : p p0 P-value: P 1 ( z0 ) Reject H 0 if z0 z Hypotheses, lower-tailed alternative H 0 : p p0 H1 : p p0 P-value: P ( z0 ) Reject H 0 if z0 z Type II error and choice of sample size Finding the probability of type II error Hypotheses, two-sided alternative H 0 : p p0 H1 : p p0 Suppose the true value of the proportion under H1 is p P{ p0 z / 2 p0 (1 p0 ) / n p p0 z / 2 p0 (1 p0 ) / n | H1} p0 z / 2 p0 (1 p0 ) / n p p0 z / 2 p0 (1 p0 ) / n p p ( 1 p ) / n p ( 1 p ) / n Type II error and choice of sample size Finding the probability of type II error Hypotheses, upper-tailed alternative H 0 : p p0 H1 : p p0 Suppose the true value of the proportion under H1 is p P{ p p0 z p0 (1 p0 ) / n | H1} p0 z p0 (1 p0 ) / n p p ( 1 p ) / n Type II error and choice of sample size Finding the probability of type II error Hypotheses, lower-tailed alternative H 0 : p p0 H1 : p p0 Suppose the true value of the proportion under H1 is p P{ p0 z p0 (1 p0 ) / n p | H1} p0 z p0 (1 p0 ) / n p 1 p ( 1 p ) / n Type II error and choice of sample size Two-sided alternative Let z be the 100 upper percentile of the standard normal distribution. Then ( z ) p0 z / 2 p0 (1 p0 ) / n p p0 z / 2 p0 (1 p0 ) / n p p ( 1 p ) / n p ( 1 p ) / n p0 z / 2 p0 (1 p0 ) / n p p(1 p) / n z p0 z / 2 p0 (1 p0 ) / n p p(1 p) / n z / 2 p0 (1 p0 ) z n p p0 p(1 p) 2 Type II error and choice of sample size Upper-tailed alternative Let z be the 100 upper percentile of the standard normal distribution. Then ( z ) p0 z p0 (1 p0 ) / n p p ( 1 p ) / n z p0 z p0 (1 p0 ) / n p p(1 p) / n z p0 (1 p0 ) z n p p0 p(1 p) 2 Type II error and choice of sample size Lower-tailed alternative Let z be the 100 upper percentile of the standard normal distribution. Then ( z ) p0 z p0 (1 p0 ) / n p 1 p ( 1 p ) / n p0 z p0 (1 p0 ) / n p p ( 1 p ) / n z p0 z p0 (1 p0 ) / n p p(1 p) / n z p0 (1 p0 ) z n p p0 p(1 p) 2 Example 9-10 Automobile Engine Controller p 0.05 , 0.05 , n 200 The semiconductor manufacturer takes a random sample of 200 devices and finds that four of them are defective. Can the manufacturer demonstrate process capability for the customer? ( p 0.05 ) Example 9-11 Automobile Engine Controller Type II Error Suppose that its process fallout is really p 0.03 . What is the -error for a test of process capability that uses n 200 and 0.05 ? Exercise 9-95 In a random sample of 85 automobile engine crankshaft bearings, 10 have a surface finish roughness that exceeds the specifications. Does this data present strong evidence that the proportion of crankshaft bearings exhibiting excess surface roughness exceeds 0.10? (a) State and test the appropriate hypotheses using 0.05 . (b) If it is really the situation that p 0.15, how likely is it that the test procedure in part (a) will not reject the null hypotheses? (c) If p 0.15 , how large would the sample size have to be for us to have a probability of correctly rejecting the null hypothesis of 0.9? , , Testing for Goodness of Fit Test the hypothesis that a particular distribution will be satisfactory as a population model Based on the chi-square distribution n observations, p is the number of parameters of the hypothesized distribution estimated by sample statistics Oi : the observed frequency in the i th class interval Ei : the expected frequency in the i th class interval 2 k ( O E ) 2 i i Test statistic: X 0 Ei i 1 2 2 P-value: P P( k p1 0 ) 2 2 Reject the hypothesis if 0 ,k p 1 Example 9-12 Printed Circuit Board Defects, Poisson Distribution Number of defects: 0, observed frequency: 32 Number of defects: 1, observed frequency: 15 Number of defects: 2, observed frequency: 9 Number of defects: 3, observed frequency: 4 Example 9-13 Power Supply Distribution, Continuous Distribution x 5.04 , s 0.08 , n 100 A manufacturer engineer is testing a power supply used in a notebook computer and, using 0.05 , wishes to determine whether output voltage is adequately described by a normal distribution. Exercise 9-101 The number of cars passing eastbound through the intersection of Mill and University Avenues has been tabulated by a group of civil engineering students. They have obtained the data in the adjacent table: (a) Does the assumption of a Poisson distribution seem appropriate as a probability model for this process? Use 0.05. (b) Calculate the P-value for this test. Data: (40, 14), (41, 24), … Contingency Table Tests Test the hypothesis that two methods of classification are statistically independent Based on the chi-square distribution n observations, r c contingency table Oij : the observed frequency for level i of the first classification and level j for the second classification c 1 r 1 Eij nuˆi vˆ j uˆi Oij , vˆ j Oij , n i 1 n j 1 r c (O E ) 2 ij ij Test statistic: X 02 Eij i 1 j 1 2 2 P-value: P P( ( r 1)(c1) 0 ) 2 2 Reject the hypothesis if 0 ,( r 1)(c1) Example 9-13 Health Insurance Plan Preference A company has to choose among three health insurance plans. Management wishes to know whether the preference for plans is independent of job classification and wants to use 0.05 . n 500 , data: … Exercise 9-107 A study is being made of the failure of an electronic component. There are four types of failures possible and two mounting positions for the device A B C D 1 20 48 20 7 2 4 17 6 12 Would you conclude that the type of failure is independent of the mounting position? Use 0.01. Find the P-value for this test. Nonparametric Procedures The sign test Test hypotheses about the median ~ of a continuous distribution ~ 0 ) r : the observed number of plus signs ( X i 0 Hypotheses, two-sided alternative ~ ~ H 0 : 0 ~ ~ H : 1 0 P-value: P 2 P( R r P 2 P ( R r or Reject H 0 if P 1 when p ) if r n / 2 2 1 when p ) if r n / 2 2 Hypotheses, upper-tailed alternative ~ ~ H0 : 0 ~ ~ H : 1 0 1 P-value: P P( R r when p ) 2 Reject H 0 if P Hypotheses, lower-tailed alternative ~ ~ H 0 : 0 ~ ~ H : 1 0 1 P P ( R r when p ) P-value: 2 Reject H 0 if P Appendix Table VIII ( r ) Hypotheses, two-sided alternative ~ ~ H0 : 0 ~ ~ H1 : 0 Reject H 0 if min( r , r ) r Hypotheses, upper-tailed alternative ~ ~ H 0 : 0 ~ ~ H1 : 0 Reject H 0 if r r Hypotheses, lower-tailed alternative ~ ~ H : 0 0 ~ ~ H : 1 0 r r H Reject 0 if Ties in the sign test ~ should be set Values of X i exactly equal to 0 aside and the sign test applied to the remaining data Normal approximation for sign test statistic R 0.5n Z0 0.5 n Reject H if | z | z for H : ~ ~ 0 0 /2 or if z0 z or if z0 z 1 0 for H1 : ~ ~0 for H1 : ~ ~0 Type II error for the sign test Finding the probability of type II error ~ , say, ~ , must Not only a particular value of be used but also the form of the underlying distribution will affect the calculations Wilcoxon signed-rank test w Appendix Table IX ( ) Rank the absolute differences | X i 0 | in ascending order, and then give the ranks the signs of their corresponding differences w : the sum of the positive ranks w : the absolute value of the sum of negative ranks Hypotheses, two-sided alternative H 0 : 0 H1 : 0 Reject H 0 if min( w , w ) w Wilcoxon signed-rank test w Appendix Table IX ( ) Hypotheses, upper-tailed alternative H 0 : 0 H1 : 0 Reject H 0 if w w Hypotheses, lower-tailed alternative H 0 : 0 H1 : 0 Reject H 0 if w w Ties in the Wilcoxon signed-rank test If several observations have the same absolute magnitude, they are assigned the average of the ranks that they would receive if they differed slightly from one another Normal approximation for Wiocoxon signen-rank test statistic Z0 W n(n 1) / 4 n(n 1)( 2n 1) / 24 ~ ~ Reject H 0 if | z0 | z / 2 for H1 : 0 or if z0 z for H1 : ~ ~0 or if z0 z for H1 : ~ ~0 Example 9-15 Propellant Shear Strength Sign Test n 20 We would like to test the hypothesis that the median shear strength is 13790 kN/m2, using 0.05 Example 9-16 Propellant Shear Strength Wilcoxon Signed-Rank Test n 20 We would like to test the hypothesis that the median shear strength is 13790 kN/m2, using 0.05 Exercise 9-117 A primer paint can be used on aluminum panels. The drying time of the primer is an important consideration in the manufacturing process. Twenty panels are selected and the drying times are as follows: 1.6, … Is there evidence that the mean drying time of the primer exceeds 1.5 hr?