MATH 40 Student Activity 3: Single Fctor ANOVA Some Bsic Concepts In designed experiment, two or more tretments, or combintions of tretments, is pplied to experimentl units The number of tretments, whether more thn one tretment is pplied to n experimentl unit (ie if tretments re given in combintion) nd if so how mny tretments re given in combintion, whether ll possible tretment combintions re used or not decides the nture of experiment Such informtion pertining to tretments is clled the TREATMENT STRUCTURE of the experiment To minimize systemtic bis, the tretments (or tretment combintions) re usully pplied ccording to rndomiztion scheme The rndomiztion used nd how tretments or tretment combintions re pplied to experimentl units will determine the nture of the design Informtion regrding the rndomiztion scheme used nd how tretments or tretment combintions re pplied to experimentl units is clled the DESIGN STRUCTURE of the experiment ONE-WAY TREATMENT STRUCTURE WITH COMPLETELY RANDOMIZED DESIGN STRUCTURE In short One-wy nlysis in CR design eg: Suppose we hve 4 blood pressure medicines plus plcebo They re to be given on one-drug-to-one ptient mnner So we hve one wy tretment structure In order to hve n estimte of ptient to ptient vrition, ech drug will be given to ten ptients We sy tht ech tretment will be replicted 10 times Suppose we select 50 ptients from the trget popultion (sy hypertensive mles between ges 45-55) rndomly Now rndomly select 10 of the 50 nd give them drug 1, chose nother 10 from the remining 40 nd give the drug, etc Here the ptients nd ssigned to the drugs in completely rndom fshion So we hve CR design structure
MATH 40 The Generl One-Wy Model Equl number of replictions Equl subclss numbers Blnced cse Suppose we hve "" tretments nd ech tretment is pplied to n experimentl units in CR design We now mesure the responses Y ij of experimentl units to tretments Suppose n pproprite model to describe the Y ij is Y ij i ij i 1,,,, j 1,,n, where ij ~ iid N0, Hence, the model implies tht Y ij independentn ~ i, i is clled the popultion men for the i th tretment, i 1,, (1) given bove is clled the mens model In contrst, the clssicl model is Y ij i ij where i j ~ iid N0, The i 's re clled the tretment effects nd is considered fixed effect (ie the tretment levels re specificlly chosen by the experimenter nd cn be replicted exctly ny number of times) Note tht i i One hypothesis the experimenter my wish to test is This is equivlent to testing : 1 3 vs H : t lest one i differs from the rest : 1 vs H : not The model () bove is over prmeterized (ie hs too mny prmeters so tht no single prmeter cn be estimted uniquely)
MATH 40 Thus, we enforce the restriction i i 1 0 With this restriction the hypotheses for the clssicl model becomes : 1 0 vs H : t lest one i is non-zero In order to test the bove hypotheses, we compute the following sums of squres n SS totl Y ij Y i 1 j 1 where Y Y / N, Y nd N n n Y ij i 1 j 1 Also compute nd compute SS tretment n Y i Y where Y i 1 n SS Error It cn be shown tht n i 1 j1 i 1 n Y ij i1 Y ij Y i, i 1,,,n SS Totl SS Tretment SS Error Thus, usully only SS Totl nd SS Tretment re computed nd then SS Error is obtined by subtrction Computtion is speeded up by using the following formuls insted of the ones given previously: n SST y NY i1 j1 ij i1 SStretment n Y NY i
MATH 40 Liner Model Theory cn be used to show tht SS Tretment ~ x 1 with non-centrlity prmeter, which becomes zero if nd only if is true Further, SS Error ~ x N with zero non-centrlity prmeter Moreover, SS Tretment nd SS Error re independent nd thus, under, F MS Tretment / MS Error ~ F 1,N, where MS Tretment SS Tretment / 1 nd MS Error SS Error / N If is flse, the bove F sttistic will hve non-centrl F distribution with the sme degrees of freedom nd hence will tend to be lrger thn centrl F rndom vrible Thus, n pproprite test for testing : 1 vs H : not is: Reject Ho t significnce level if F F, 1, N The results re usully summrized in n nlysis of vrince tble s follows: ANOVA Source of Vrition df SS MS F Tretments 1 SS Tretment MS Tretment MS Tretment MS Error Error N SS Error MS Error Totl (djusted for the men) N 1 SS Totl MS Totl Note: MS Totl SS Totl / N 1 Remrk: A computer output would lwys give the p -vlue of the F -test
MATH 40 An Exmple of Anlysis of Vrince of Dt from Blnced One-wy Experiment conducted in Completely Rndomized Design The wether resistnce of four pints ws tested by crrying out the following experiment Twenty metl pnels were rndomly selected from stockpile nd their surfces were prepred for pinting From these, four pnels were rndomly selected nd primer ws pplied to them The sme primer ws pplied to the other sixteen pnels, but unlike the first four, ech of these were then pinted with one of the four pints Specificlly, ech pint ws pplied to four rndomly selected pnels The primer coted but unpinted pnels s well s the pinted pnels were then rndomly lid out in n re open to the elements After two yers, the pnels were gthered nd the cumultive re of rust in ech pnel ws mesured (in squre mm) The resulting dt is s follows: Primer only Ltex A Oil Bsed I Oil bsed II Oil bsed III 0 150 150 130 10 40 130 140 10 130 00 140 130 10 100 40 160 10 110 10 We will now construct the ANOVA tble for the bove experiment Note tht Y 11 =0, Y 1 =40,, Y 14 =40,, Y 54 =10 Y1 = 5, Y = 145, Y3 = 135, Y4 = 10, Y5 = 1175, Y = 1485 5 4 Yij =475,100 i1 j1 So, SST= 475,100 N(1485) = 475,100 0(1485) = 34,0550 Note tht we used formul tht looks different from wht is given in notes, but this is equivlent to tht formul 5 Also, SSTretment = n( Yi ) N(1485) = 4(118,0815) - 0(1485) i1 = 31,800 Agin, note tht we used formul tht looks different from wht is given in notes, but this is equivlent to tht formul Now, by subtrction, SSE = SST SSTretment = 34,0550 31,800 = 7750
MATH 40 ANOVA Source of Vrition DF Sum of Squres Men Squres F rtio Tretment 4 31,800 7,800 4707 Error 15 7750 1850 Totl 19 34,0550 1,7937 Now let us test the hypothesis of no tretment differences ginst the lterntive tht t lest one tretment men is different from the others t 005 significnce level From F-tbles, F005, 4, 15 30556 Since 4707 > 30556, we reject the null hypothesis of no tretment difference nd conclude tht t lest one tretment men is different from the others Plese note tht in computing SSTotl we cn use either of two formuls n (, ) n n Yi j i1 j1 i, j i, j i1 j1 i1 j1 N SST Y NY Y Note tht NY = n ( Y ) i1 j1 N i, j Similrly, we hve two choices in computing SSTretment n (, ) Yi j i1 j1 i n i i1 i1 N SSTretment n Y NY Y
MATH 40 Running the Single Fctor Anlysis of Vrince on SAS Suppose tht you wnt to determine whether the men of the vrible rust vries by different type of pint You cn use PROC GLM (generl liner model) to conduct one-wy ANOVA In ddition, you cn request summry nd dignostic plots using ODS Grphics Here is the progrm: options ls=78; dt pint; input pint $ rust; dtlines; primer 0 primer 40 primer 00 primer 40 ltex 150 ltex 130 ltex 140 ltex 160 oil1 150 oil1 140 oil1 130 oil1 10 oil 130 oil 10 oil 10 oil 110 oil3 10 oil3 130 oil3 100 oil3 10 ; proc print dt= pint; run; ods grphics on; title "Running one-wy ANOVA"; proc glm dt=pint plots=dignostics; clss pint; model rust = pint/solution ss3 ss1; mens pint/hovtest; run; Remrk: 1 you specified the independent vrible on CLASS sttement you use MODEL sttement to specify your dependent vrible s well s your design
MATH 40 3 The MEANS sttement tht follows the MODEL sttement requests tht PROC GLM print the men nd stndrd devition for your dependent vrible for ech vlue of your independent vrible The HOVTEST option on the MEANS sttement requests tht SAS perform Levene s test for homogeneity of vrince 4 The order of sttements within procedure usully does not mtter However, in PROC GLM, you must specify your CLASS sttement before your MODEL sttement nd your MODEL sttement before the MEANS sttement (or before other sttements such s lest squres mens or contrsts) 5 By defult, PROC GLM produces both Type I nd Type III sum of squres (SS) s output Type I SS shows the effect of ech fctor s it is entered into the design; type III SS shows the effect of ech fctor, controlling for ll the other fctors They re the sme in the one fctor cse You cn specify the SS3 in the option if you only wnt to see Type III SS Plese interpret the bove SAS output
MATH 40 Assignment: 1 Redo problem 33 on textbook Plese mke sure to include the SAS code nd output Four different designs for digitl computer circuit re being studied in order to compre the mount of noise present The following dt hve been obtined () Is the sme mount of noise present for ll four designs? (b) Anlyze the resuduls from this experiment Are the nlysis of vrince ssumptions stisfied? (c) Use Tukey s test to compre pirs of tretment mens Wht is your conclusion? (d) Use LSD method to compre pirs of tretment mens Wht is your conclusion? (e) Construct set of orthogonl contrsts (f) Compre the tretments mens of circuit design 1 to design, 3, nd 4 (g) Compre the tretments mens of circuit design 4 to design 1 nd 3 A phrmceuticl mnufcturer wnts to investigte the bioctivity of new drug A completely rndomized single-fctor experiment ws conducted with three dosge levels, nd the following results were obtined (Plese do this problem without SAS) () Construct the ANOVA tble (b) Is there evidence to indicte tht dosge level ffects bioctivity? Why? (c) Set the µ1 s the popultion men for dosge 0g, µ s the popultion men for dosge 30g, nd µ3 s the popultion men for dosge 40g Use t-test to compre the 0g nd 30g tretment mens Tht is, to test H0: µ1= µ (d) Use either t-test or F-test for testing dosge 40g versus dosge 0g nd 30g Tht is, to test H0: µ1 + µ - *µ3=0 (e) Construct set of orthogonl contrsts, nd compute the sums of squres for ech tretment (f) Use Scheffe s method to compre the tretment mens between 30g nd 40g dosge (g) Use Tukey s method to compre the tretment mens between 30g nd 40g dosge (h) Use LSD method to compre the tretment mens between 30g nd 40g dosge (i) Assume tht dosge 0g is control tretment, pply Dunnett s test to compre tretment mens with the control