Test about a Population Mean Test about a Population Mean Test for Population Mean of A Normal Population with Known σ Null hypothesis: Test statistic value H0 : µ = µ0 x̄−µ √0 z = σ/ n Alternative Hypothesis Ha : µ > µ0 Ha : µ < µ0 Ha : µ 6= µ0 Rejection Region for Level α Test z ≥ zα (upper-tailed test) z ≤ −zα (lower-tailed test) z ≥ zα/2 or z ≤ −zα/2 (two-tailed test) Test about a Population Mean Test about a Population Mean H0 : µ = µ0 v.s. Ha : µ > µ0 Then the rejection region for level α test is z ≥ zα , or equivalently √ x̄ ≥ µ0 + zα · σ/ n. Let µ0 denote a particular value of µ that is less than the null value µ0 , then β(µ0 ) = P(H0 is not rejected | µ = µ0 ) √ = P(X < µ0 + zα · σ/ n | µ = µ0 ) X − µ0 µ0 − µ 0 0 √ < zα + √ |µ=µ =P σ/ n σ/ n µ0 − µ 0 √ = Φ zα + σ/ n Test about a Population Mean Test about a Population Mean Alternative Hypothesis Ha : µ > µ0 Ha : µ < µ0 Ha : µ 6= µ0 Type II Error Probability β(µ0 ) for Level α Test 0 √ Φ zα + µσ/0 −µ n 0 µ0 −µ 1 − Φ −zα + σ/√n 0 √ Φ zα/2 + µσ/0 −µ − Φ −zα/2 + n 0 µ0 −µ √ σ/ n Test about a Population Mean Test about a Population Mean Test for Population Mean of A Normal Population with Unknown σ Null hypothesis: Test statistic value H0 : µ = µ0 √0 t = x̄−µ s/ n Alternative Hypothesis Ha : µ > µ0 Ha : µ < µ0 Ha : µ 6= µ0 Rejection Region for Level α Test t ≥ tα,n−1 (upper-tailed test) t ≤ −tα,n−1 (lower-tailed test) t ≥ tα/2,n−1 or t ≤ −tα/2,n−1 (two-tailed test) Test about a Population Proportion Let p denote the proportion of individuals or objects in a population who possess a specified property (labeled as “S”). Let X be the number of S’s in the sample. Then p̂ = Xn is the sample proportion. Test about a Population Proportion Let p denote the proportion of individuals or objects in a population who possess a specified property (labeled as “S”). Let X be the number of S’s in the sample. Then p̂ = Xn is the sample proportion. X is a binomial random variable with parameters p and n, i.e. X ∼ Bin(n, p). Test about a Population Proportion Let p denote the proportion of individuals or objects in a population who possess a specified property (labeled as “S”). Let X be the number of S’s in the sample. Then p̂ = Xn is the sample proportion. X is a binomial random variable with parameters p and n, i.e. X ∼ Bin(n, p). Furthermore, when the sample size n itself is large, both X and p̂ are approximately normally distributed, i.e. X ∼ N(np, np(1 − p)) and p̂ ∼ N(p, p(1−p) ). n Test about a Population Proportion Let p denote the proportion of individuals or objects in a population who possess a specified property (labeled as “S”). Let X be the number of S’s in the sample. Then p̂ = Xn is the sample proportion. X is a binomial random variable with parameters p and n, i.e. X ∼ Bin(n, p). Furthermore, when the sample size n itself is large, both X and p̂ are approximately normally distributed, i.e. X ∼ N(np, np(1 − p)) and p̂ ∼ N(p, p(1−p) ). n Test about population proportion p will depend on the sample size. Test about a Population Proportion Large-Sample Tests When the sample size is large (n ≥ 30), p̂ is approximately normally distributed with mean p and variance p(1 − p)/n. In particular, under the null hypothesis H0 : p = p0 , p̂ is approximately normally distributed with mean p0 and variance p0 (1 − p0 )/n, i.e. p̂ ∼ N(p0 , p0 (1 − p0 )/n). Therefore the test statistic p̂ − p0 Z=p p0 (1 − p0 )/n has approximately a standard normal distribution. Test about a Population Proportion Example: Problem 35 State DMV records indicate that of all vehicles undergoing emissions testing during the previous year, 70% passed on the first try. A random sample of 200 cars tested in a particular county during the current year yields 124 that passed on the initial test. Does this suggest that the true proportion for this county during the current year differs from the previous statewide proportion? Test the relevant hypotheses using significance level α = 0.5 Test about a Population Proportion Example: Problem 35 State DMV records indicate that of all vehicles undergoing emissions testing during the previous year, 70% passed on the first try. A random sample of 200 cars tested in a particular county during the current year yields 124 that passed on the initial test. Does this suggest that the true proportion for this county during the current year differs from the previous statewide proportion? Test the relevant hypotheses using significance level α = 0.5 In this case, p̂ = 124/200 = 0.62. The null hypothesis is H0 : p = 0.70 and the alternative hypothesis is Ha : p 6= 0.70. Test about a Population Proportion 1. Parameter of interest: population proportion p. Test about a Population Proportion 1. Parameter of interest: population proportion p. 2. Null hypothesis: H0 : p = 0.70. Test about a Population Proportion 1. Parameter of interest: population proportion p. 2. Null hypothesis: H0 : p = 0.70. 3. Alternative hypothesis: Ha : p 6= 0.70. Test about a Population Proportion 1. Parameter of interest: population proportion p. 2. Null hypothesis: H0 : p = 0.70. 3. Alternative hypothesis: Ha : p 6= 0.70. 4. Test statistic value: p̂ − p0 0.62 − 0.70 z=p =p = −2.469 p0 (1 − p0 )/n 0.70(1 − 0.70)/200 Test about a Population Proportion 1. Parameter of interest: population proportion p. 2. Null hypothesis: H0 : p = 0.70. 3. Alternative hypothesis: Ha : p 6= 0.70. 4. Test statistic value: p̂ − p0 0.62 − 0.70 z=p =p = −2.469 p0 (1 − p0 )/n 0.70(1 − 0.70)/200 5. Rejection region: z ≥ z0.025 or z ≤ −z0.025 , where z0.025 = 1.96. Test about a Population Proportion 1. Parameter of interest: population proportion p. 2. Null hypothesis: H0 : p = 0.70. 3. Alternative hypothesis: Ha : p 6= 0.70. 4. Test statistic value: p̂ − p0 0.62 − 0.70 z=p =p = −2.469 p0 (1 − p0 )/n 0.70(1 − 0.70)/200 5. Rejection region: z ≥ z0.025 or z ≤ −z0.025 , where z0.025 = 1.96. 6. Conclusion: since −2.469 < −1.96, we reject H0 . Test about a Population Proportion Summary for large-sample tests for population proportion p Null hypothesis: H0 : p = p0 Test statistic value: z = √ p̂−p0 p0 (1−p0 )/n Alternative Hypothesis Ha : p > p0 Ha : p < p0 Ha : p 6= p0 Rejection Region z ≥ zα (upper-tailed) z ≤ −zα (lower-tailed) either z ≥ zα/2 or z ≤ −zα/2 (two-tailed) Remark: These test procedures are valid provided that np0 ≥ 10 and n(1 − p0 ) ≥ 10. Test about a Population Proportion Type II Error β for large-sample tests Alternative Hypothesis β(p 0 ) Ha : p > p0 Φ p0 −p 0 +zα √ Ha : p < p0 1−Φ Ha : p > p0 Φ Φ p0 −p 0 −zα √ √ p0 (1−p0 )/n p 0 (1−p 0 )/n p0 −p 0 +zα/2 √ √ p0 (1−p0 )/n p 0 (1−p 0 )/n √ p0 (1−p0 )/n p 0 (1−p 0 )/n p0 −p 0 −zα/2 √ √ p0 (1−p0 )/n p 0 (1−p 0 )/n − Test about a Population Proportion Small-Sample Tests When the sample size n is small (n ≤ 30), we test the hypotheses based directly on the binomial distribution. Test about a Population Proportion Small-Sample Tests When the sample size n is small (n ≤ 30), we test the hypotheses based directly on the binomial distribution. For example, if the null hypothesis is H0 : p = p0 and the alternative hypothesis is Ha : p > p0 , then the rejection region is of the form X ≥ c, where X ∼ Bin(n, p). Test about a Population Proportion Small-Sample Tests When the sample size n is small (n ≤ 30), we test the hypotheses based directly on the binomial distribution. For example, if the null hypothesis is H0 : p = p0 and the alternative hypothesis is Ha : p > p0 , then the rejection region is of the form X ≥ c, where X ∼ Bin(n, p). P(type I error) = P(reject H0 | H0 ) = P(X ≥ c | p = p0 ) = 1 − P(X < c | p = p0 ) = 1 − P(X ≤ c − 1 | p = p0 ) = 1 − B(c − 1; n, p0 ) Test about a Population Proportion Small-Sample Tests When the sample size n is small (n ≤ 30), we test the hypotheses based directly on the binomial distribution. For example, if the null hypothesis is H0 : p = p0 and the alternative hypothesis is Ha : p > p0 , then the rejection region is of the form X ≥ c, where X ∼ Bin(n, p). P(type I error) = P(reject H0 | H0 ) = P(X ≥ c | p = p0 ) = 1 − P(X < c | p = p0 ) = 1 − P(X ≤ c − 1 | p = p0 ) = 1 − B(c − 1; n, p0 ) And P(type II error) = P(fail to reject H0 | p = p 0 ) = P(X < c | p = p 0 ) = P(X ≤ c − 1 | p = p 0 ) = B(c − 1; n, p 0 ) Test about a Population Proportion Small-Sample Tests Remark: in the samll-sample case, it is usually not possible to find a vale c for which P(type I error) is exactly the desired significance level α. Therefore we choose the largest rejection region which statisfying P(type I error) < α. Test about a Population Proportion Example: A coin is tossed 10 times and x = 6 heads are observed. Let p = P(head). Do you believe the coin prefers head with significance level 0.10? Test about a Population Proportion 1. Parameter of interest: proportion for “Heads” p. Test about a Population Proportion 1. Parameter of interest: proportion for “Heads” p. 2. Null hypothesis: H0 : p = 0.5. Test about a Population Proportion 1. Parameter of interest: proportion for “Heads” p. 2. Null hypothesis: H0 : p = 0.5. 3. Alternative hypothesis: Ha : p > 0.5. Test about a Population Proportion 1. Parameter of interest: proportion for “Heads” p. 2. Null hypothesis: H0 : p = 0.5. 3. Alternative hypothesis: Ha : p > 0.5. 4. Test statistic: X = number of heads. Test about a Population Proportion 1. Parameter of interest: proportion for “Heads” p. 2. Null hypothesis: H0 : p = 0.5. 3. Alternative hypothesis: Ha : p > 0.5. 4. Test statistic: X = number of heads. 5. Rjection region: X ≥ c for some c. Test about a Population Proportion 1. Parameter of interest: proportion for “Heads” p. 2. Null hypothesis: H0 : p = 0.5. 3. Alternative hypothesis: Ha : p > 0.5. 4. Test statistic: X = number of heads. 5. Rjection region: X ≥ c for some c. 6. Significance level: 0.10 ≥ P(type I error) = P(reject H0 | H0 ) = P(X ≥ c | p = 0.5) = 1 − P(X < c | p = 0.5) = 1 − P(X ≤ c − 1 | p = 0.5) = 1 − B(c − 1; 10, 0.5) Therefore c − 1 = 7 and c = 8. Test about a Population Proportion 1. Parameter of interest: proportion for “Heads” p. 2. Null hypothesis: H0 : p = 0.5. 3. Alternative hypothesis: Ha : p > 0.5. 4. Test statistic: X = number of heads. 5. Rjection region: X ≥ c for some c. 6. Significance level: 0.10 ≥ P(type I error) = P(reject H0 | H0 ) = P(X ≥ c | p = 0.5) = 1 − P(X < c | p = 0.5) = 1 − P(X ≤ c − 1 | p = 0.5) = 1 − B(c − 1; 10, 0.5) Therefore c − 1 = 7 and c = 8. 7. Conclusion: since 6 < 7, we fail to reject H0 . P-value Example: Problem 35 State DMV records indicate that of all vehicles undergoing emissions testing during the previous year, 70% passed on the first try. A random sample of 200 cars tested in a particular county during the current year yields 124 that passed on the initial test. Does this suggest that the true proportion for this county during the current year differs from the previous statewide proportion? P-value Example: Problem 35 State DMV records indicate that of all vehicles undergoing emissions testing during the previous year, 70% passed on the first try. A random sample of 200 cars tested in a particular county during the current year yields 124 that passed on the initial test. Does this suggest that the true proportion for this county during the current year differs from the previous statewide proportion? Hypothesis: H0 : p = 0.70 v.s. Ha : p 6= 0.70. Value of the test statistic: p̂ − p0 0.62 − 0.70 z=p =p = −2.469 p0 (1 − p0 )/n 0.70(1 − 0.70)/200 Significance Level .05 .02 .01 .002 z z z z Rejection Region ≥ 1.96 or z ≤ −1.96 ≥ 2.33 or z ≤ −2.33 ≥ 2.58 or z ≤ −2.58 ≥ 3.08 or z ≤ −3.08 Conclusion Reject H0 Reject H0 Fail to reject H0 Fail to reject H0 P-value Definition The P-value (or observed significance level) is the smallest level of significance at which H0 would be rejected when a specified test procedure is used on a given data set. Once the P-value has been determined, the conclusion at any partivular level α results from comparing the P-value to α: 1. P-value ≤ α ⇒ reject H0 at level α. 2. P-value > α ⇒ fail to reject H0 at level α. Convention: it is customary to call the data significant when H0 is rejected and not significant otherwise. P-value An equivalent definition for P-value: Definition The P-value is the probability calculated assuming H0 is true, of obtaining a test statistic value at least as contradictory to H0 as the value that actually resulted. The smaller the P-value, the more contradictory is the data to H0 . P-value P-value for z Tests for an upper-tailed test 1 − Φ(z) P = Φ(z) for a lower-tailed test 2[1 − Φ(|z|)] for a two-tailed test where Φ(z) is the cdf for standard normal rv. P-value P-value Example: To determine whether the pipe welds in a nuclear power plant meet specifications, a random sample of 10 welds is selected, and tests are conducted on each weld in the sample. The sample data is recorded as follows 101.9 100.4 101.2 100.9 101.7 with X = 101.10. 101.5 100.9 100.1 101.6 100.8 It is known that the weld strength is normally distributed with mean µ and standard deviation σ = 2. If the specifications state that the mean strength should be greater than 100 lb/in2 , shall we accept that the pipe welds meet the specifications?