* ch22eg1.sas, using data of Table 22.1; title 'Sec 22.3. Example of Single-Factor Covariance Analysis'; options ls=78 nodate; ; data promo; input y x A; lines; 38 21 1 39 26 1 36 22 1 45 28 1 33 19 1 43 34 2 38 26 2 38 29 2 27 18 2 34 25 2 24 23 3 32 29 3 31 30 3 21 16 3 28 29 3 ; * Plot the data; proc plot; plot y*x=A; title1 'Analysis of Covariance: Cracker Promotion Example'; title2 'Plot of raw data'; ; * ANCOVA and comparison of treatment effects; proc glm; class A; model y = x A; estimate 'A1-A2' A 1 -1 0; estimate 'A1-A3' A 1 0 -1; estimate 'A2-A3' A 0 1 -1; lsmeans A / CL pdiff adjust=bonf; title2 'ANCOVA and comparison of treatment effects'; ; * Test for unequal slopes; proc glm; class A; model y = x A x*A; title2 'Test for unequal slopes'; Analysis of Covariance: Cracker Promotion Example 1 Plot of raw data Plot of y*x. Symbol is value of A. y 45 + 1 | 44 + | 43 + 2 | 42 + | 41 + | 40 + | 39 + 1 | 38 + 1 2 2 | 37 + | 36 + 1 | 35 + | 34 + 2 | 33 + 1 | 32 + 3 | 31 + 3 | 30 + | 29 + | 28 + 3 | 27 + 2 | 26 + | 25 + | 24 + 3 | 23 + | 22 + | 21 +3 -+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 x Analysis of Covariance: Cracker Promotion Example 2 ANCOVA and comparison of treatment effects The GLM Procedure Class Level Information Class Levels Values A 3 1 2 3 Number of observations 15 Analysis of Covariance: Cracker Promotion Example 3 ANCOVA and comparison of treatment effects The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 3 607.8286915 202.6095638 57.78 <.0001 Error 11 38.5713085 3.5064826 Corrected Total 14 646.4000000 R-Square Coeff Var Root MSE y Mean 0.940329 5.540120 1.872560 33.80000 Source DF Type I SS Mean Square F Value Pr > F x 1 190.6777778 190.6777778 54.38 <.0001 A 2 417.1509137 208.5754568 59.48 <.0001 Source DF Type III SS Mean Square F Value Pr > F x 1 269.0286915 269.0286915 76.72 <.0001 A 2 417.1509137 208.5754568 59.48 <.0001 Standard Parameter Estimate Error t Value Pr > |t| A1-A2 5.0753902 1.22896513 4.13 0.0017 A1-A3 12.9768307 1.20562330 10.76 <.0001 A2-A3 7.9014406 1.18874585 6.65 <.0001 Analysis of Covariance: Cracker Promotion Example 4 ANCOVA and comparison of treatment effects The GLM Procedure Least Squares Means Adjustment for Multiple Comparisons: Bonferroni Least Squares Means for effect A Pr > |t| for H0: LSMean(i)=LSMean(j) Dependent Variable: y i/j 1 2 3 1 0.0050 <.0001 2 0.0050 0.0001 3 <.0001 0.0001 Least Squares Means for Effect A Difference Simultaneous 95% Between Confidence Limits for i j Means LSMean(i)-LSMean(j) 1 2 5.075390 1.609667 8.541113 1 3 12.976831 9.576932 16.376729 2 3 7.901441 4.549137 11.253744 Analysis of Covariance: Cracker Promotion Example 5 Analysis of Covariance: Cracker Promotion Example 6 Test for unequal slopes The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 5 614.8791646 122.9758329 35.11 <.0001 Error 9 31.5208354 3.5023150 Corrected Total 14 646.4000000 Source DF Type I SS Mean Square F Value Pr > F x 1 190.6777778 190.6777778 54.44 <.0001 A 2 417.1509137 208.5754568 59.55 <.0001 x*A 2 7.0504731 3.5252366 1.01 0.4032 Source DF Type III SS Mean Square F Value Pr > F x 1 243.1412380 243.1412380 69.42 <.0001 A 2 1.2632832 0.6316416 0.18 0.8379 x*A 2 7.0504731 3.5252366 1.01 0.4032