A overview Mot probability ditributio are idexed by oe me parameter. F example, N(µ,σ 2 ) B(, p). I igificace tet, we have ued poit etimat f parameter. F example, f iid Y 1,Y 2,...,Y N(µ,σ 2 ), Ȳ i a poit etimat of µ ad S 2 i a poit etimat of σ 2. Note that E(Ȳ ) = µ ad E(S2 ) = σ 2. That i, Ȳ i a ubiaed etimat of µ ad S 2 i a ubiaed etimat of σ 2. Aother example, f Y B(, p), ˆp = Y/ i a ubiaed (poit) etimat of p, becaue E(ˆp) = p. Now we tudy iterval etimat to give a reaoable iterval f parameter (e.g. (c 1,c 2 ) f µ). The aumptio are the ame a i igificace tetig, but we do ot eed a ull hypothei o the parameter (e.g. µ = µ 0 ). Nmal ditributio with kow σ 2 Suppoe Y 1,Y 2,...,Y are iid from N(µ,σ 2 ) ad σ 2 i kow. We kow that Ȳ etimate µ, but Ȳ ca be off omewhat. Our goal i to get a plauible rage of value f µ baed o the ample data. Recall that Ȳ N(µ, σ ) Hece 0.95 = P( 1.96 Z 1.96) = P( 1.96 Ȳ µ σ/ 1.96) = P( 1.96 σ Ȳ µ 1.96 σ ) = P(Ȳ 1.96 σ µ Ȳ + 1.96 σ ) Note that Ȳ i radom ad µ i fixed. The iterval ȳ 1.96 σ µ ȳ + 1.96 σ i called a 95% cofidece iterval f µ ( 0.95 CI f µ). 131 132 Nmal CI example Suppoe there are eight () obervatio i a ample from N(µ, 16) ad the oberved ample mea i ȳ = 11.00. The =,σ 2 = 16, ad a 95% CI f µ i which i 11.00 1.96 4 µ 11.00 + 1.96 4.23 µ 13.77 11.00 ± 2.77 Remark It i ot true that P(.23 µ 13.77) = 0.95 becaue oce a ample i oberved, there i othig radom. The 95% probability ha to do with the procedure. It i iterpreted a, 95% of the time, the CI calculated i thi way cotai µ. F a igle cae, it i iterpreted a havig 95% cofidece that µ i betwee.23 ad 13.77. The iterval [.23, 13.77] ca be thought of a a plauible rage of µ. 133 134
Remark I geeral, let z α/2 deote the z-ce uch that P( z α/2 Z z α/2 ) = 1 α. Nmal CI example cotiued Cotiued with the CI example that ha ȳ = 11.00, =,σ 2 = 16. Fid a 90% CI f µ. Sice 1 α = 0.90, we have α = 0.10,α/2 = 0.05,z α/2 = 1.645 (uig Table A the table o page 92). The a 90% CI f µ i The we have 1 α = P(Ȳ z σ α/2 µ Ȳ + z σ α/2 ) A 100(1 α)% cofidece iterval f µ ( (1 α) CI f µ) i σ µ ȳ + z α/2 σ ȳ ± z α/2 σ which i 11.00 1.645 4 µ 11.00 + 1.645 4.67 µ 13.33 11.00 ± 2.33 By covetio, CI are two-ided. But oe-ided cofidece boud are poible. 135 136 Nmal ditributio with ukow σ 2 Suppoe Y 1,Y 2,...,Y are iid from N(µ,σ 2 ) ad σ 2 i ukow. Recall that Ȳ µ S/ T 1 Let t α/2 deote the t-ce uch that P( t 1,α/2 T 1 t 1,α/2 ) = 1 α. The we have 1 α = P(Ȳ t S 1,α/2 µ Ȳ + t S 1,α/2 ) A (1 α) CI f µ i ȳ t 1,α/2 µ ȳ + t 1,α/2 ȳ ± t 1,α/2 Tomato weight example Recall a radom ample of = 16 tomatoe that ha a ample mea weight of ȳ = 32.50 gm. Previou we aumed that the weight of tomatoe have a mal ditributio N(µ, (5) 2 ). Thu a 95% CI f µ i 32.50 1.96 5 16 µ 32.50 + 1.96 5 16 which i [30.05, 34.95] 32.50 ± 2.45. But uppoe we do ot kow what σ i. Compute a ample variace which tur out to 2 = 30.02. The ice 1 α = 0.95, we have α = 0.05,α/2 = 0.025, t 1,α/2 = t 15,0.025 = 2.131 (uig Table C), ad / = 30.02/16 = 1.370 The a 95% CI f µ i 32.50 2.131 1.370 µ 32.50 + 2.131 1.370 which i [29.5, 35.42] 32.50 ± 2.92. 137 13
Iferece f upecified ditributio Suppoe we have a large umber of obervatio from a upecified ditributio with mea µ ad variace σ 2. Alo uppoe that σ 2 i ukow. Our goal i to cotruct a CI f µ. By the CLT ad S 2 σ 2 whe i large, we have the fact that Ȳ µ S/ N(0, 1) Thu a approximate (1 α) CI f µ i µ ȳ + z α/2 F example, f a radom ample of ize = 5, the oberved ample mea ad ample variace are ȳ = 25.50, 2 = 2.3. F a 95% CI, z α/2 = z 0.025 = 1.96 ad 2.3 25.50 1.96 µ 25.50 + 1.96 5 which i [25.14, 25.6] 25.50 ± 0.36. 2.3 5 Remark If σ i kow, the a approximate (1 α) CI f µ i σ µ ȳ + z α/2 σ Up util thi poit, there i a exact relatio betwee igificace tetig ad CI. If a (1 α) CI cotai the hypotheized value i H 0 : µ = µ 0, the do ot reject H 0 at the α level. If a (1 α) CI doe ot cotai the hypotheized value i H 0 : µ = µ 0, the reject H 0 at the α level. Cautio: Thi relatio doe ot alway hold (e.g. biomial). Suppoe Y 1,Y 2,...,Y are iid from N(µ,σ 2 ). A 95% CI f σ 2 i ( 1)S 2 χ 2 σ 2 ( 1)S2 1,0.025 χ 2 1,0.975 139 140 Remark F example, uppoe a radom ample of ize = from N(µ,σ 2 ) with ukow σ 2. Suppoe the oberved ample ad ample variace are ȳ = 37.1,S 2 = 6.29. F tetig H 0 : µ = 35 veru H A : µ 35, we ue t-tet. The oberved t-ce i t = ȳ µ 0 / = 37.1 35 6.29/ = 2.36 ad t 7,0.025 = 2.365 (uig Table C). Thu barely reject H 0 at the 5% level. A 95% CI f µ i 37.1 2.365 6.29/ µ 37.1 + 2.365 6.29/ which i [35.003, 39.197], which doe ot cotai 35 (but barely). Iferece f biomial ditributio Now coider Y B(, p) ad cotruct a (1 α) CI f p uig mal approximatio. Recall that ˆp = Y/ i a poit etimat of p with E(ˆp) = p, V ar(ˆp) = pq Alo recall that whe p 5,q 5, we ca approximate the ditributio of ˆp by ˆp NA N(p, pq ). F tetig H 0 : p = p 0, ue ˆp p 0 N(0, 1) p0 (1 p 0 )/ Now ice ˆp p, ˆp p N(0, 1) ˆp(1 ˆp)/ Thu a approximate (1 α) CI f p i ˆp z α/2 ˆp(1 ˆp) p ˆp + z α/2 ˆp(1 ˆp) 141 142
Biomial CI example I a experimet, a drug i give to treat 200 rat with a certai dieae ad 63 of them are cured. Let p deote the cure rate. Let Y deote the umber of rat cured ad aume that Y B(, p). Cotruct a 95% CI f p. Here = 200,y = 63, ad the oberved ˆp i y/ = 63/200 = 0.315. Sice ˆp = 63 5,(1 ˆp) = 137 5, we ue mal approximatio. Sice z α/2 = z 0.025 = 1.96, a 95% CI f p i A quick ummary Y 1,...,Y σ kow σ ukow N(µ,σ 2 σ ) mall ȳ ± z α/2 ȳ ± t 1,α/2 N(µ,σ 2 σ ) large ȳ ± z α/2 ȳ ± t 1,α/2 D(µ, σ 2 ) mall o geeral reult o geeral reult D(µ, σ 2 σ ) large ȳ ± z α/2 by CLT ȳ ± z α/2 by CLT 0.315 0.65 0.315 0.65 0.315 1.96 200 p 0.315 + 1.96 200 which i [0.251, 0.379] 0.315 ± 0.064. Nmal approximatio i appropriate if ˆp 5,(1 ˆp) 5. The relatio betwee igificace tetig ad CI f p i ot exact, becaue differet variace term are ued. 143 144 Key R commad # Nmal CI example ybar = 11 d = 4 = alpha = 0.05 z = qm(alpha/2, lower.tail=f) z*d/qrt() [1] 2.7710 c(ybar-z*d/qrt(),ybar+z*d/qrt()) [1].22192 13.7710 # Nmal CI example cotiued alpha = 0.10 z = qm(alpha/2, lower.tail=f) z*d/qrt() [1] 2.326174 c(ybar-z*d/qrt(),ybar+z*d/qrt()) [1].67326 13.326174 Key R commad # Tomato weight example ybar = 32.5 = 16 alpha = 0.05 d = 5 z = qm(alpha/2, lower.tail=f) z*d/qrt() [1] 2.449955 c(ybar-z*d/qrt(),ybar+z*d/qrt()) [1] 30.05005 34.94995 # Fruit ca example cotiued d = qrt(30.02) d/qrt() [1] 1.369763 t = qt(alpha/2, -1, lower.tail=f) t [1] 2.131450 t*d/qrt() [1] 2.9195 c(ybar-t*d/qrt(),ybar+t*d/qrt()) [1] 29.5042 35.4195 # directly t.tet(x, cof.level = 0.95) #CLT CI example ybar = 25.5 d = qrt(2.3) = 5 alpha = 0.05 z = qm(alpha/2, lower.tail=f) z*d/qrt() [1] 0.357623 c(ybar-z*d/qrt(),ybar+z*d/qrt()) [1] 25.14237 25.5763 145 146
Key R commad #Biomial CI example y=63 =200 phat = y/ alpha = 0.05 z = qm(alpha/2, lower.tail=f) z*qrt(phat*(1-phat)/) [1] 0.06437743 c(phat-z*qrt(phat*(1-phat)/),phat+z*qrt(phat*(1-phat)/)) [1] 0.2506226 0.3793774 #, directly prop.tet(y,, cof.level=0.95) 1-ample proptio tet with cotiuity crectio data: y out of, ull probability 0.5 X-quared = 26.645, df = 1, p-value = 2.445e-07 alterative hypothei: true p i ot equal to 0.5 95 percet cofidece iterval: 0.2523053 0.349353 ample etimate: p 0.315 147