Chapter 7 Notes - Inference for Single Samples You know already for a large sample, you can invoke the CLT so: X N(µ, ). Also for a large sample, you can replace an unknown σ by s. You know how to do a hypothesis test for the mean, either: calculate z-statistic x µ 0 z = and compare it with z α or z α/. calculate pvalue and compare with α or α/. calculate CI and see whether µ 0 is within it. Let s add two more calculations. 1) Determine n to achieve a certain width for a -sided confidence interval. Of course, small width large n. Derivation of Sample Size Calculation for CI z α/ σ n = E where E is the half-width of the CI. (Sample Size Calculation) ) Power Calculation For upper 1-sided z-tests: H 0 : µ µ 0 H 1 : µ > µ 0, in fact, we ll take µ = µ 1. The calculation only makes sense if µ 1 > µ 0. We want to know what the power of the test is to detect mean µ 1. We ll compute power as a function of µ 1. Derivation of Power Calculation for Upper 1-sided z-tests µ 1 µ 0 π(µ 1 ) = P (test rejects H 0 in favor of H 1 H 1 ) = Φ z α +. 1
Now we can consider π(µ 1 ) as a function of µ 1. Again, the alternative hypothesis only make sense if µ 1 > µ 0. As µ 1 increases, what happens to π(µ 1 )? For lower 1-sided tests, ( µ 0 µ ) 1 π(µ 1 ) = Φ z α +. The alternative hypothesis only makes sense when µ 1 < µ 0. As µ 1 increases (and gets closer to a µ 0 ), what happens to π(µ 1 )? For -sided tests, ( ) ( ) σ σ π(µ 1 ) = P X < µ 0 z α/ µ = µ 1 + P X > µ 0 + z α/ µ = µ 1 n n ( ) ( ) µ 0 µ 1 µ 1 µ 0 = Φ z α/ + + Φ z α/ + As µ 1 changes, what happens to π(µ 1 )?
3) Sample size calculation for power. Want to find the n required to guarantee a certain power, 1 β, for an α-level z-test. Let := µ 1 µ 0 so that µ 1 = µ 0 +. For upper 1-sided, we have (look up at the power calculation we did for upper 1-sided): ( ) π(µ 1 ) = π(µ 0 + ) = Φ z α + = 1 β. Since our notation says that z β is defined as the number where Φ(z β ) = 1 β: Now solve that for n: z α + = z β. (z α + z β )σ n =. For lower 1-sided, n is the same by symmetry. For -sided, turns out one of the two terms of π(µ 1 ) can be ignored to get an approximation: (z α/ + z β )σ n. Remember to round up to the next integer when doing sample-size calculations! 3
7. Inferences on Small Samples If n < 30, we often need to use the t-distribution rather than z-distribution N(0, 1) since s doesn t approximate σ very well. Need X 1,..., X n N(µ, ). The bottom line is that we replace: X µ X µ Z = by T = S/ n for a t-test on the mean. Replace z α by t n 1,α. Replace σ by S. There s a chart in your book on page 53 that summarizes this. Note that the power calculation is harder for t-tests, so for this class, just say S σ and use the normal distribution power calculation. You ll get an approximation. 7.3 Inferences on Variances Assume X 1,..., X n N(µ, ). Inferences on variance are very sensitive to this assumption, so inference only with caution! The bottom line is that we replace: X µ (n 1)S Z = by χ = (and test for not µ). Replace z α by χ and/or χ n 1,1 α n 1,α. Hypothesis tests on variance are not quite the same as on the mean. Let s do some of the computations to show you. First, we ll compute the CI. 4
-sided CI for. As usual, start with what we know: ( ) (n 1)S (n 1)S 1 α = P χ χ and remember χ =, n 1,1 α/ n 1,α/ (*1) (*) and we want: 1 α = P (L U) for some L and U. Let s solve it on the left for (*1) and on the right for (*): Putting it together we have: 1 α = P (n 1)S (n 1)S χn 1,1 α/ χ n 1,α/ (n 1)S χ n 1,α/ (n 1)S χ n 1,1 α/ 1 α = P L U. The 100(1 α)% confidence interval for is then Similarly, 1-sided CI s for are: (n 1)s (n 1)s. χ n 1,α/ χ n 1,1 α/ (n 1)s (n 1)s and. χ χ n 1,α n 1,1 α Hypothesis tests on Variance (a chi-square test) To test H = = 0 : 0 vs H 1 : 0, we can either: Compute χ statistic: χ = (n 1)s and reject H 0 when either χ > χ n 1,α/ or χ < χ n 1,1 α/. Compute pvalue: First we calculate the probability to be as extreme in either direction: 0 5
P U = P (χ n 1 χ ) or P L = P (χn 1 χ ) depending on which is smaller (more extreme). The probability to obtain a χ at least as extreme under H 0 is: min(p U, P L ). This accounts for being extreme in either direction. Compute CI (already done) Table 7.6 on page 57 summarizes the chi-square hypothesis test on variance. Note that this is not the most commonly used chi-square test! See Wikipedia: A chi-square test is any statistical hypothesis test in which the sampling distribution of the test statistic is a chi-square distribution when the null hypothesis is true... (n 1)S (In this case, we have normal random variables, so the distribution of the test statistic is chi-square.) 6
MIT OpenCourseWare http://ocw.mit.edu 15.075J / ESD.07J Statistical Thinking and Data Analysis Fall 011 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.