ENGI 44 Cofidece Itervals (Two Samples) Page -0 Two Sample Cofidece Iterval for a Differece i Populatio Meas [Navidi sectios 5.4-5.7; Devore chapter 9] From the cetral limit theorem, we kow that, for sufficietly large sample sizes from two idepedet populatios of meas, ad variaces,, the sample meas are distributed as ~ N,, ~ N,, with ~ lso, for sufficietly large sample sizes, we may estimate ukow values of, by s, s. Example.0 large corporatio wishes to determie the effectiveess of a ew traiig techique. radom sample of 64 employees is tested after udergoig the ew traiig techique ad obtais a mea test score of 6. with a stadard deviatio of 5.. other radom sample of 00 employees, servig as a cotrol group, is tested after udergoig the old traiig methods. The cotrol group has a sample mea test score of 58.3 with a stadard deviatio of 6.30. (a) (b) Use a two-sided cofidece iterval to determie whether the ew traiig techique has led to a sigificat chage i test scores. Use a oe-sided cofidece iterval to determie whether the ew traiig techique has led to a sigificat icrease i test scores.
ENGI 44 Cofidece Itervals (Two Samples) Page -0 Example.0 (cotiued) If a two-sided 00% cofidece iterval does ot iclude a value c, the the appropriate oe-sided 00% cofidece iterval will ot iclude c. If a oe-sided 00% CI icludes c, the the two-sided 00% CI icludes c.
ENGI 44 Cofidece Itervals (Two Samples) Page -03 Two Sample Cofidece Iterval for a Differece i Populatio Proportios [for bous questios oly] We kow that whe a radom sample cosists of idepedet eroulli radom quatities, with a probability p of success i each trial, the umber of successes i the radom sample follows a biomial distributio with p ad pq. Provided the expected umbers of successes (p) ad failures (q) are both more tha 0, the sample proportio P of successes i the radom sample follows a ormal distributio to a good approximatio: P ~ N p, pq If we draw radom samples of sizes ad (both large) from two idepedet populatios whose true probabilities of success are p ad p, the the differece i sample proportios is p q p q P P ~ N p p, This allows us to costruct cofidece itervals for the ukow p p. The traditioal approach util the 990 s was to replace the ukow values of p ad p i the expressio for the variace by the sample proportios, leadig to the 00% cofidece iterval pˆ ˆ ˆ ˆ q p q pˆ ˆ p z / However, simulatios show that this cofidece iterval ca be very iaccurate for sample sizes of about 30 or less. more accurate iterval (the gresti-caffo iterval) ca be achieved by addig oe to the observed umbers of successes, x* x ad y* y ad addig two to the sample sizes, * ad *. x* y* It the follows that p*, q* p*, p*, q* p* * * The two-sided 00% cofidece iterval for p p is therefore p* q* p* q* p* p* z / * * If the lower boud is below, the replace it by. If the upper boud is above +, the replace it by +. This iterval works well eve for small sample sizes.
ENGI 44 Cofidece Itervals (Two Samples) Page -04 Example.0 [ot examiable except for bous] radom sample of 5 compoets (produced by oe machie) yields 5 compoets that are loger tha 0.0 cm. other radom sample of 30 compoets (produced by aother machie) yields compoets that are loger tha 0.0 cm. Costruct a 95% cofidece iterval for the differece i populatio proportios of compoets that are loger tha 0.0 cm. Ca oe coclude that the two populatio proportios are differet? Usig the gresti-caffo 95% cofidece iterval for p p, x 6 x 5, 5 p * q * 7 7 3 9 x, 30 p* q* 3 3 6 3 6 p* p*.8634 7 3 864 leadig to the stadard error s p * q * p * q * 6 39 *.837 3 3 * * 7 3 z.05.959 Therefore the 95% CI is p * p * z s.86.959.8.86.5.05 Correct to 3 s.f., the 95% CI is.065 p p.438 This cofidece iterval icludes zero. Therefore p p is plausible from these data. NO, we caot coclude that the two populatio proportios are differet, (eve though the sample proportios differ by 0%!) We eed much larger sample sizes i order for a 0% differece i sample proportios to be sigificat. [Note: the traditioal 95% CI is.00 ±.60 = [.060, +.460] ]
ENGI 44 Cofidece Itervals (Two Samples) Page -05 Example.03 [ot examiable except for bous] Suppose that radom samples of equal size are draw from two idepedet populatios. Fid the smallest value of for which a observed differece i sample proportios of 0% would allow us to coclude, at a level of cofidece of 95%, that the populatio proportios are differet. The expressio for the stadard error i ˆ ˆ pq pq p q p q P P is where q p ad q p. The maximum possible value of occurs whe both p p ad p p are as large as they ca be. y x x x x is a quadratic fuctio whose uique maximum occurs whe ut dy x 0 dx, that is, at x. the maximum value of occurs whe p q p q : With pˆ ˆ p.0, the lower boud of the traditioal 95% cofidece iterval for p p is.0.95.0.95 For the CI to be guarateed to exclude zero,.95.0.95 0.0.95 9.5.0 9.5 9.07 Therefore a miimum sample size of 93 items from each populatio will guaratee that a observed differece of sample proportios of 0% will geerate a 95% cofidece iterval for p p that excludes zero. With such large sample sizes, the gresti-caffo CI will be very close to the traditioal CI.
ENGI 44 Cofidece Itervals (Two Samples) Page -06 Small Sample Cofidece Iterval for the Differece betwee Two Meas Suppose,,, is a radom sample of size draw from a populatio ~ N, ad that,,, is a radom sample of size draw from a populatio ~ N,, with idepedet of, the Z ~ N 0, If at least oe of the sample sizes is small (less tha 30 or so), the the cetral limit theorem caot be ivoked. Z will be ormal (exactly or to a acceptable approximatio) oly if both populatios are exactly or early ormal. If, i additio, both populatio variaces are kow, the Z follows the stadard ormal distributio (exactly or approximately) o matter how small the sample sizes may be. However, if the populatio variaces are ot kow, the they must be replaced by their poit estimators from the data (the sample variaces): T S S The additioal ucertaity, (itroduced by the fact that S ad S are themselves radom quatities), results i T followig Studet s t-distributio istead of the stadard ormal distributio. For ay particular pair of radom samples, the umber of degrees of freedom is s s INT s s
ENGI 44 Cofidece Itervals (Two Samples) Page -07 Example.04 ivestigator wats to kow which of two electric toasters has the greater ability to resist the abormally high electrical currets that occur durig a uprotected power surge. Radom samples of six toasters from factory ad five toasters from factory were subjected to a destructive test, i which each toaster was subjected to icreasig currets util it failed. The distributio of currets at failure (measured i amperes) is kow to be approximately ormal for both products. The results are as follows: Factory : 0 8 4 6 3 6 Factory : 8 9 7 (a) State the assumptios that you are makig. (b) Costruct a 95% cofidece iterval for the mea differece i failure currets. (c) Is there ay sigificat differece betwee the failure currets of the two types of toaster? (a) Give i the questio: ssumptio: (b) The summary statistics are 6 x 4.5 5 x 9.4 s 7.9 s 4.3 s.36 s 0.86 s s s. e..76 s. e..475353 The most tedious part of this set of calculatios is for the umber of degrees of freedom:
ENGI 44 Cofidece Itervals (Two Samples) Page -08 Example.04 (cotiued) s s INT s s.76 INT INT 8.9 8.36 0.86 5 4 For a 95% two-sided cofidece iterval with 8 degrees of freedom, we eed t.05, 8.30600 x x t s e.05, 8.. 4.5 9.4.30600.475353 5. 3.40 Therefore the 95% CI for is, correct to d.p.,.7, 8.5 Excel spreadsheet for this example is available at " www.egr.mu.ca/~ggeorge/44/demos/cismall_.xls " The textbooks (Navidi sectio 5.6; Devore sectio 9.) provide a alterative more precise cofidece iterval that may be used oly whe the populatio variaces ca safely be assumed to be equal ( pooled t procedures ). We shall ot employ that iterval i this course.
ENGI 44 Cofidece Itervals (Two Samples) Page -09 Cofidece Itervals for Paired Data Example.05 Nie voluteers are tested before ad after a traiig programme. ased o the data below, ca you coclude that the programme has improved test scores? Voluteer: 3 4 5 6 7 8 9 fter traiig: 75 66 69 45 54 85 58 9 6 efore traiig: 7 65 64 39 5 85 5 9 58 Let = score after traiig ad = score before traiig. INCORRECT METHOD: The summary statistics are 9, x 67., x 64., s s 5.94 3.993 943.5 943.5 9 8 546.5 s 546.5 9 8 s 8.94 3.438 s s 4490 s. e. 55.43 s. e. 7.44573 8 s s 55.43 INT INT s s 3.993 3.438 8 8 = INT(5.7...) = 5.050,5.75305 t We eed a oe-sided CI because we are lookig for evidece of a icrease, ot a chage.
ENGI 44 Cofidece Itervals (Two Samples) Page -0 Example.05 (cotiued) The lower boudary of the 95% oe-sided CI for is x x t s e.050,5.. 67. 64..75305 7.44573 3.0 3.05 We are 95% sure that 0.. Clearly zero is a very plausible value. We would coclude that the data are cosistet with ad therefore there is owhere ear eough evidece to coclude that the traiig has improved test scores. ut look agai at the test scores: Voluteer: 3 4 5 6 7 8 9 fter traiig: 75 66 69 45 54 85 58 9 6 efore traiig: 7 65 64 39 5 85 5 9 58 There is a clear patter of icreases from the before score to the after score for most idividuals. There is cosiderable variatio betwee idividuals, which is swampig the idividual icreases. The error i the aalysis above is that CORRECT METHOD: The remedy is to explore oly the differeces, ot the two sets of scores. Voluteer: 3 4 5 6 7 8 9 Differece d : Now we have a sigle sample, from which to costruct a oe-sided cofidece iterval for the true mea differece. D 933 7 3 D 9, d 3.0, s 6.5 sd.549 98 s D se.. 0.849836 t.050,8.85955 D d t.050, 8 s. e. 3.0.85 0.84 3.0.58.4
ENGI 44 Cofidece Itervals (Two Samples) Page - Paired vs. Upaired Cofidece Itervals Whe the sample sizes are equal, the questio arises as to which type of cofidece iterval to use: two-sample (upaired) or the iterval based o differeces (paired). If the samples are pairs of observatios of two differet effects o the same set of idividuals, the idepedece betwee the populatios is ulikely ad oe should use the paired cofidece iterval. Otherwise use the upaired cofidece iterval. The paired cofidece iterval is valid eve if the two populatios are strogly correlated, whereas the upaired cofidece iterval is based o the assumptio that the two populatios are idepedet (or at least ucorrelated). Example.06 (Navidi textbook, exercises 5.7, page 373, questio 6) sample of 0 diesel trucks were ru both hot ad cold to estimate the differece i fuel ecoomy. The results, i miles per gallo, are preseted i the followig table. (from I-use Emissios from Heavy-Duty Diesel Vehicles, J. aowitz, Ph.D. thesis, Colorado School of Mies, 00.) Truck Hot Cold 4.56 4.6 4.46 4.08 3 6.49 5.83 4 5.37 4.96 5 6.5 5.87 6 5.90 5.3 7 4. 3.9 8 3.85 3.69 9 4.5 3.74 0 4.69 4.9 Fid a 98% cofidece iterval for the differece i mea fuel mileage betwee hot ad cold egies. Choice of type of cofidece iterval:
ENGI 44 Cofidece Itervals (Two Samples) Page - Example.06 (cotiued) Summary statistics: Truck Hot Cold Differece 4.56 4.6 0.30 4.46 4.08 0.38 3 6.49 5.83 0.66 4 5.37 4.96 0.4 5 6.5 5.87 0.38 6 5.90 5.3 0.58 7 4. 3.9 0.0 8 3.85 3.69 0.6 9 4.5 3.74 0.4 0 4.69 4.9 0.50 d d 0, 3.98,.806 d 3.98 d 0.398, 0 d d 0.806 3.98.856 sd 09 90 0.04 84 sd 0.5 sd 0.55834 s. e. 0.049 79 0 [Ed of Chapter ]