Hypothesis testig: ANOVA Test of the equality of meas amog groups February 6, 200 Moez Hababou() Flow-hart Desribig iformatios Drawig olusios Foreastig Improve busiess proesses Data Colletio Probability & Probability Distributio Regressio Aalysis Time-series Aalysis Summary tables ad harts estimatio Hypothesis testig Simple Regressio model Multiple Regressio model Desriptive Statistis Oe sample Two samples Two or more samples February 6, 200 Moez Hababou() 2
Proedure for hypothesis testig for the mea differee betwee two samples State ull hypothesis H o : µ =µ 2 = =µ State alterative hypothesis H A : at least oe µ is differet Determie test statistis F=(SSA/-)/(SSW/-) Determie reetio regios Choose ofidee level Make olusios February 6, 200 Moez Hababou() 3 Illustratig ull ad alterative hypotheses µ µ2 µ3 Η Α : µ=µ3<µ2 µ µ2 µ3 Η ο : µ=µ3=µ2 February 6, 200 Moez Hababou() 4 2
Deomposig total variatio Total Variatio (SST) df=- Amog group variatio (SSA) df= - withi group variatio (SSW) df= - February 6, 200 Moez Hababou() 5 SST = Deomposig variatio: Total variatio SST = = umber of observatio s i group# = total umber of observatio s i all group ombied = i= = i= + 2 ( +... + ) = grad mea = observatio #i i group# i = umber of groups i i February 6, 200 Moez Hababou() 6 3
SSA = Amog-group variatio: SSA = = = umber = total umber = + = = i= i= = ( 2 ) grad mea for group# +... + = umber of groups i i mea of observatio s i group# of observatio s i all group 2 ombied February 6, 200 Moez Hababou() 7 Withi-group variatio: SSW SSW = i = = = umber = total umber = + ( mea for group# observatio #ii group# i= = = i= 2 +... + = umber of groups i i ) of observatio s i group# of observatio s i all group 2 ombied February 6, 200 Moez Hababou() 8 4
Calulatig the mea squares ad the oe-way ANOVA F-test statisti SSA MSA = SSW MSW = SST MST = MSA F = = MSW SSA SSW Mea squared sum amog groups Mea squared sum withi groups Total mea squared sum oe-way ANOVA F-test statisti February 6, 200 Moez Hababou() 9 ANOVA summary table Soure of variatio Degrees of freedom Sum of squares Mea square F P-value Amog groups - SSA MSA=SSA/(-) F=MSA/MS W Withi groups - SSW MSW=SSW/(-) Total - SST=SSA+ SSW Exerise: LKB 7.42 pp394 February 6, 200 Moez Hababou() 0 5
Deisio rule F=MSA/MSW follows F-distributio with -, - degree of freedom At a level of sigifiae α, we would Reet Ho: µ =µ 2 =... =µ if F>F U(α,-,-) I that ase olude that at least oe group mea µ is statistially differet from the other group meas Do ot Reet Ho: µ =µ 2 =... =µ if F<F U(α,-,-) I that ase olude that we a ot ifer at least o µ is statistially differet from the other group meas February 6, 200 Moez Hababou() Reetio ad aeptae regio -a Do ot Reet Ho Reet Ho a F U,α February 6, 200 Moez Hababou() 2 6
Assumptios Radomess ad idepedee betwee samples (samples draw from idepedet radom populatios) Pseudo-ormality of eah sampled group Homogeeity of variae σ 2 =σ2 2 =... =σ2 February 6, 200 Moez Hababou() 3 Example# It is widely believed that eduatio ad holdig additioal degrees irease salary. Verify this statemet, a sample of 44 employees from ompay A were radomly seleted. They a either hold o degree, or a ollege, or a uiversity degree. Is it true, at the 5% level, that all three groups of employees have equal average salaries at ompay A? February 6, 200 Moez Hababou() 4 7
ANOVA: umerial appliatio Salary Degree i-barbar (i-barbar) 2 (i-bar) (i-bar) 2 23,253-3,284 0,782,244 -,82,398,99 26,399-38 8,943,964 3,855,5 9,876-6,66 44,364,028-4,559 20,788,626 23,602-2,935 8,62,069-833 694,646 2,864-4,673 2,833,497-2,57 6,62,378 9,33-7,224 52,80,870-5,22 26,239,54 22,98-3,556 2,642,524 -,454 2,5,438 25,0 -,427 2,035,28 675 455,02 30,83 4,294 8,44,590 6,396 40,903,002 30,657 4,20 6,977,426 6,222 38,707,628 24,904 -,633 2,665,490 469 29,535 26,209 2-328 07,343 89 7,846 2,69 2-4,98 24,83,2-4,50 20,262,79 23,602 2-2,935 8,62,069-2,58 6,342,444 22,447 2-4,090 6,725,096-3,673 3,494,02 23,602 2-2,935 8,62,069-2,58 6,342,444 23,43 2-3,24 9,757,08-2,707 7,330,28 2,455 2-5,082 25,822,99-4,665 2,766,53 25,072 2 -,465 2,45,49 -,048,099,86 2,669 2-4,868 23,693,848-4,45 9,85,48 24,740 2 -,797 3,227,889 -,380,905,562 23,602 2-2,935 8,64,006-2,59 6,344,06 25,784 2-753 566,456-336 3,79 26,20 2-47 73,583 0 0 23,449 2-3,087 9,532,426-2,67 7,35,582 29,598 2 3,06 9,37,970 3,478 2,093,556 33,675 2 7,38 50,956,287 7,555 57,07,665 27,29 2 592 350,899,009,07,232 32,70 2 6,64 37,999,424 6,58 43,304,02 3,728 2 5,9 26,950,294 5,608 3,444,943 29,87 2 2,650 7,024,447 3,067 9,403,907 3,728 2 5,9 26,950,294 5,608 3,444,943 3,728 3 5,9 26,950,294 2,537 6,435,946 34,6 3 7,624 58,30,976 4,970 24,700,072 30,00 3 3,473 2,064,280 89 670,625 33,675 3 7,38 50,956,287 4,484 20,05,509 35,33 3 8,596 73,897,530 5,942 35,306,374 22,897 3-3,640 3,246,926-6,294 39,65,485 24,450 3-2,087 4,354,036-4,74 22,477,87 34,34 3 7,597 57,79,989 4,943 24,432,425 24,772 3 -,765 3,3,929-4,49 9,528,298 28,775 3 2,238 5,00,288-46 73,25 24,740 3 -,797 3,227,889-4,45 9,82,43 25,88 3-79 56,433-3,373,377,69 SST= 80,9,555 SSW= 664,363,935 February 6, 200 Moez Hababou() 5 Computig SST, SSW, SSA SST=80,9,555 groups divided by degree group = No degree -bar=24,435 group2 = ollege degree 2-bar= 26,20 group3 = uiversity degree 3-bar= 29,9 SSW = = i= ( i ) 2 = 664,363,935 SST=SSA+SSW => SSA=SST-SSW =3675562 February 6, 200 Moez Hababou() 6 8
Alterative way to ompute SSA umber of groups =3 total sample size =44 SSA bar bar-barbar (bar-barbar) 2 *(bar-barbar)2 group 24,435-2,0 4,44,950 48564447 group2 2 26,20-46 73,232 3637877 group3 2 29,9 2,654 7,046,08 84553296 barbar= 26,537 SSA 3675562 February 6, 200 Moez Hababou() 7 Hypothesis testig Ho: µ=µ2=µ3 Ha: at least oe µ i is differet Soure of variatio degree of freedom sum of squares mea squared variae F amog groups 2 3675562 6837780.29 4.2980973 betwee groups 4 664,363,935 6203998.4 total 43 80,9,555 reet Ho if F>F U(α, -,-) F U(α, 3-,44-3) =3.2256793 Sie F=4.2> F α,-,- Colusio: Reet Ho, at least oe group of employees has a salary that is statistially differet from the others February 6, 200 Moez Hababou() 8 9
Example#2 The retailig maager would like to kow whether produt pakagig has ay effet o the sale of offee paks. He observed reetly the five more reet daily sales (give ai umber of uits sold) for three types of pakages ad wishes if you a help him i this exerises? Day Day 2 Day 3 Day 4 Day 5 sober 23 22 6 5 24 shiy February 6, 200 Moez Hababou() 9 26 24 25 28 3 vitage 33 2 24 29 30 ANOVA table ANOVA Soure SS df MS F P-value Amog 68.9333 2 84.46667 5.224742 0.023326 Withi 94 2 6.6667 Total 362.9333 4 F.05,2,2 =3.88 F=5.22>F.05,2,2 =3.88 Reet Ho, at least oe group has average daily sales that is statistially differet from the other groups February 6, 200 Moez Hababou() 20 0
ANOVA versus 2 sample T-test ANOVA ust idiates that oe group mea is differet from the other ad does ot tell whether sigifiatly smaller (equivalet to two-tail test). 2 sample T-test a be a prohibitive exerise whe dealig with umerous groups (umber of pairs to ompare = (-)/2. T-tests are usually easier to reet. February 6, 200 Moez Hababou() 2 Sharp proedure for ANOVA (STAT) (TEST) (IputList)(ENTER)(ENTER) Eter data i L, L2,, L (=umber of groups) For this partiular exerise, use L=23, 22, 6, 5, 24 L2=26, 24, 25, 28, 3 L3=33, 2, 24, 29, 30 Hit 2dF (Matrix) Selet ANOVA Number of meas C= (eter 3 for this exerise) February 6, 200 Moez Hababou() 22
ANOVA proedure output SST SSW SSA 362.93, 94, 68 MSA NDF(-) MSW DDF(-) 84.4, 2, 6.6, 2 F P-value 5.22.0233 Group meas 20 26.8 27.4 ANOM H LDL GRAND-MEAN UDL 2.67 20.8 24.73 28.65 February 6, 200 Moez Hababou() 23 Hypothesis testig usig the p-value approah Deisio Rule: Reet Ho if p-value<α February 6, 200 Moez Hababou() 24 2
ANOM The Aalysis of Mea (ANOM) allows us to idetify whih group has a mea that is sigifiatly differet from the others. It also speifies whether it is sigifiatly smaller or sigifiatly larger. It is based o derivig a upper ad lower limits (UDL ad LDL). If -bar (mea group ) is larger tha UDL, we olude that it is sigifiatly larger tha the other groups average. If -bar (mea group ) is less tha LDL, we olude that it is sigifiatly larger tha the other groups average. February 6, 200 Moez Hababou() 25 LDL ad UDL LDL=barbar - h α,,- * square root(msw*(-)/) UDL=barbar + h α,,- * square root(msw*(-)/) barbar = grad mea h α,,- = Nelso s statisti at, - degree of freedom = total umber of observatios MSW = Mea squared sum withi groups MSW = SSW/- February 6, 200 Moez Hababou() 26 3
Sharp 9600-CL output Group meas 20 26.8 27.4 ANOM H LDL GRAND-MEAN UDL 2.67 20.8 24.73 28.65 February 6, 200 Moez Hababou() 27 30 28 26 Graphial represetatio of ANOM UDL 3-bar 2-bar barbar 24 22 LDL 20 -bar February 6, 200 Moez Hababou() 28 4
Suggested exerises LKB 7.42,7.4, 7.44, 7.47 February 6, 200 Moez Hababou() 29 5