环境数据分析课件 (24).pdf
Chapter 7 ANOVA First things first!ANOVAOne-way ANOVATwo-way ANOVANo Interaction Effect in Two-way ANOVAInteraction Effect in Two-way ANOVAAnalysis of Variance-ANOVAOutcomeABCThe variable affect the outcome directlyABImpression of Water qualityMain effectTwo-way ANOVA-Interaction EffectInteraction effects occur when the effect of one variable dependes on the value of another variable.It commonly happened in regression analysis,ANOVA,and designed experiments.In two or multiple tests,the interacted effect will occur to influence the data analysis.Two-way ANOVA-Interaction EffectFactor A:level of r as A1,A2,.,Ai,Ar;Factor B:level of s as B1,B2,.,Bj,BS:(Ai,Bj):xijk(i=1,2,3,r;j=1,2,3,s;c=1,2,3,.c);xijk means the kth test on the (Ai,Bj)Factor B1B2BjBsA1111,112,11c121,122,12c1j1,1j2,1jc1s1,1s2,1scA2211,212,21c221,222,22c2j1,2j2,2jc2s1,2s2,2sc.Aii11,i12,i1ci21,i22,i2cij1,ij2,ijk ijcis1,is2,iscArr11,r12,r1cr21,r22,r2crj1,rj2,rjcrs1,rs2,rscWith interaction effectTable x Two-Way ANOVA experiments with interaction effectTwo-way ANOVA-Interaction EffectInteraction Two-way ANOVA ApproachClaim identified:The model as following:),.2,1,.2,1,.2,1(,)2,0()(cksjriNxijkijjiijkrii10sjj10 as factor A ith effectij as factor B jth effectH01H02H03risjijij110)()(as the interaction effect of factor A ith and factor B jth ij)(Two-way ANOVA-Interaction EffectTwo-way ANOVA-Interaction EffectInteraction Two-way ANOVA ApproachClaim identified:Factor A H01:1=2=3.=r H1:Means of A are not all equal.Factor B H02:1=2=3.=s H2:Means of B are not all equal.AB H03:the effect of A dose not depend on B H3:There is an interaction effect between A and B.The hypothese of interest in two-way ANOVA are as following:Two-way ANOVA-Interaction Effectijkijjiijkx)(xxxxxxxxxxxjiijkjiijkjiijkij)()()(risjjiijkABxxxxcSS112)(Two-way ANOVA-Interaction EffectInteraction Two-way ANOVA Approach2111)(risjckijkTxxSS21211riisjriiAxxscxxSS21211sjjrisjjBxxrcxxSS211risjjiijABxxxxcSSSSe=SST-SSA-SSB-SSAB 2111)(risjckijkexijxSSTwo-way ANOVA-Interaction Effect1 rscdfT1 rdfA1 sdfB)1)(1(1)1()1()1(srsrrssrrsdfAB)1()1()1(crsrsrscdfeTwo-way ANOVA-Interaction EffectSum of squaresDegree of freedomMean squaresFCritical valuep-valueASSAr-1*BSSBs-1*ABSSAB(r-1)(s-1)*ErrorSSErs(c-1)Total SSTrsc-1FA F(r-1,(rsc-1),reject H01,significant difference in means(0.05:*or 0.01:*):main effectFB F(s-1,(rsc-1),reject H02,significant difference in means(0.05:*or 0.01:*):main effectFAB F(r-1)(s-1),(rsc-1),reject H03,significant difference in means(0.05:*or 0.01:*):interaction effectOtherwise,accept null hypothesis.1rSSMSAA1sSSMSBB)1)(1(srSSMSABAB)1(crsSSMSeeeAMSMS eBMSMS eABMSMS)1(),1(rscrFA)1(),1(rscsFB)1(),1)(1(rscsrFABTwo-way ANOVATwo-way ANOVA-Interaction EffectExample:Two-way ANOVA-Interaction Effect Factor BFactor A1234133.3525.4528.2528.95232.6026.0028.4027.70331.8525.2028.5028.95ijx77.28 xAssumption:Average of repeated variables),.2,1,.,2,1,.,2,1(,)(cksjrixijkijjiijk)4,3,2,1,3,2,1(,jixjiijEstimated cell means:ijx Factor BFactor A1234132.83325.78328.61728.767232.50825.45828.29228.442332.45825.40828.24228.392Two-way ANOVA-Interaction EffectFactor BFactor A123410.650.351.550.05-0.65-0.35-1.55-0.052-0.60.50.3-0.10.6-0.5-0.30.131.550.31.2-0.15-1.55-0.3-1.20.15The residuals/errors:SSe=15.23)2,1,4,3,2,1,3,2,1(kji,xxijijk2ijksTwo-way ANOVA-Interaction EffectExample:211risjjiijABxxxxcSSSSe=SST-SSA-SSB-SSAB Two-way ANOVA-Interaction EffectExample:SourcedfSSMSFF crit.p valueA20.660.330.263.88 FINV(0.05,2,12).77 FDIST(0.26,2,12)B3151.4650.4939.783.49 FINV(0.05,3,12).000 FDIST(39.78,3,12)AB64.400.730.583.00 FINV(0.05,6,12).74 FDIST(0.58,6,12)Error1215.231.27Total23171.75Interaction effect:F F crit.,p value=.74.05,accetp H0:There is no evidence of a significant interaction between A and B.ANOVA TableTwo-way ANOVA-Interaction EffectFactor BFactor A123411.167 0.017 1.183 0.233-0.133-0.683-1.917 0.133 2-0.508 1.042 0.408-0.842 0.692 0.042-0.192-0.642 30.942 0.092 1.458 0.408-2.158-0.508-0.942 0.708 The residuals/errors:)2,1,4,3,2,1,3,2,1(kji,xxijkijkijkjiijkijx 0)(SSe=19.632ijksTwo-way ANOVA-Interaction EffectExample:SourcedfSSMSFF crit.p valueA20.660.330.303.55 FINV(0.05,2,18).74 FDIST(0.30,2,18)B3151.4650.4946.303.16 FINV(0.05,3,18).00 FDIST(3.26,3,18)Error1819.631.09Total23171.75Main effects:Factor A(Irrigation),F.05,no significantFactor B(Land type),F F crit.,p value=.00.01,extremely significantANOVA TableeABSSSSeABdfdfTwo-way ANOVA-Interaction EffectTips:There was a significant interaction between A and B,we should not test for the main effects of those factors.In the example,there is no interaction,but that there are significant main effects of factor A and B.We can use a Bonferroni procedure(Post-hoc tests)to determine for which levels the effects of factor A(B)are different.Two-way ANOVA-Interaction EffectHomework One-way and two-way ANOVA performed by hand to get more familiar with them.SPSS,R and Excel applications.Multiple factors ANOVA,Analysis of covariance,Multivariate analysis of variance,if interested,please self-study.Be prepared for the ANOVA applied in regression.ANOVAMr“data”familycultureprocess of growthhereditary