* ch17eg1.sas; * This SAS program fits a treatment effects (1-way ANOVA) model to * the Kenton Food Company data of Table 16.1, then illustrates * analysis of factor effects; options ls=78 nodate; ; data KFC; input y A j; * A=i; drop j; lines; 11 1 1 17 1 2 16 1 3 14 1 4 15 1 5 12 2 1 10 2 2 15 2 3 19 2 4 11 2 5 23 3 1 20 3 2 18 3 3 17 3 4 27 4 1 33 4 2 22 4 3 26 4 4 28 4 5 ; proc glm; title 'Kenton Food Company, Table 16.1 data.'; title2 'ANOVA and analysis of factor effects'; class A; model y = A; means A; * option for multiple comparison procedures, alpha=0.05 is the default; * the option "bon" would request Bonferonni's method; means A / alpha=0.05 tukey; * Least Squares Means, with multiple comparions options; lsmeans A / pdiff=all cl adjust=Tukey alpha=0.05; * testing one linear combination, in this case a pairwise comparison; contrast 'A3-A2' A 0 -1 1 0; * testing 3 contrasts simultaneously; contrast 'A' A -1 1 0 0, A -1 0 1 0, A -1 0 0 1; * information for constructing a CI for a pairwise comparison; estimate 'A3-A2' A 0 -1 1 0; * information for constructing a CI for a treatment mean; estimate 'A1' intercept 1 A 1 0 0 0; Kenton Food Company, Table 16.1 data. 1 ANOVA and analysis of factor effects The GLM Procedure Class Level Information Class Levels Values A 4 1 2 3 4 Number of Observations Read 19 Number of Observations Used 19 Kenton Food Company, Table 16.1 data. 2 ANOVA and analysis of factor effects The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 3 588.2210526 196.0736842 18.59 <.0001 Error 15 158.2000000 10.5466667 Corrected Total 18 746.4210526 R-Square Coeff Var Root MSE y Mean 0.788055 17.43042 3.247563 18.63158 Source DF Type I SS Mean Square F Value Pr > F A 3 588.2210526 196.0736842 18.59 <.0001 Source DF Type III SS Mean Square F Value Pr > F A 3 588.2210526 196.0736842 18.59 <.0001 Kenton Food Company, Table 16.1 data. 3 ANOVA and analysis of factor effects The GLM Procedure Level of --------------y-------------- A N Mean Std Dev 1 5 14.6000000 2.30217289 2 5 13.4000000 3.64691651 3 4 19.5000000 2.64575131 4 5 27.2000000 3.96232255 Kenton Food Company, Table 16.1 data. 4 ANOVA and analysis of factor effects The GLM Procedure Tukey's Studentized Range (HSD) Test for y NOTE: This test controls the Type I experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 15 Error Mean Square 10.54667 Critical Value of Studentized Range 4.07597 Comparisons significant at the 0.05 level are indicated by ***. Difference A Between Simultaneous 95% Comparison Means Confidence Limits 4 - 3 7.700 1.421 13.979 *** 4 - 1 12.600 6.680 18.520 *** 4 - 2 13.800 7.880 19.720 *** 3 - 4 -7.700 -13.979 -1.421 *** 3 - 1 4.900 -1.379 11.179 3 - 2 6.100 -0.179 12.379 1 - 4 -12.600 -18.520 -6.680 *** 1 - 3 -4.900 -11.179 1.379 1 - 2 1.200 -4.720 7.120 2 - 4 -13.800 -19.720 -7.880 *** 2 - 3 -6.100 -12.379 0.179 2 - 1 -1.200 -7.120 4.720 Kenton Food Company, Table 16.1 data. 5 ANOVA and analysis of factor effects The GLM Procedure Least Squares Means Adjustment for Multiple Comparisons: Tukey-Kramer LSMEAN A y LSMEAN Number 1 14.6000000 1 2 13.4000000 2 3 19.5000000 3 4 27.2000000 4 Least Squares Means for effect A Pr > |t| for H0: LSMean(i)=LSMean(j) Dependent Variable: y i/j 1 2 3 4 1 0.9353 0.1549 0.0001 2 0.9353 0.0583 <.0001 3 0.1549 0.0583 0.0142 4 0.0001 <.0001 0.0142 A y LSMEAN 95% Confidence Limits 1 14.600000 11.504380 17.695620 2 13.400000 10.304380 16.495620 3 19.500000 16.038991 22.961009 4 27.200000 24.104380 30.295620 Least Squares Means for Effect A Difference Simultaneous 95% Between Confidence Limits for i j Means LSMean(i)-LSMean(j) 1 2 1.200000 -4.719758 7.119758 1 3 -4.900000 -11.178852 1.378852 1 4 -12.600000 -18.519758 -6.680242 2 3 -6.100000 -12.378852 0.178852 2 4 -13.800000 -19.719758 -7.880242 3 4 -7.700000 -13.978852 -1.421148 Kenton Food Company, Table 16.1 data. 6 ANOVA and analysis of factor effects The GLM Procedure Dependent Variable: y Contrast DF Contrast SS Mean Square F Value Pr > F A3-A2 1 82.6888889 82.6888889 7.84 0.0135 A 3 588.2210526 196.0736842 18.59 <.0001 Standard Parameter Estimate Error t Value Pr > |t| A3-A2 6.1000000 2.17853162 2.80 0.0135 A1 14.6000000 1.45235441 10.05 <.0001