Performing multiple comparisons in an analysis of covariance (ANCOVA) model with unequal slopes in PROC GLM


To compute or compare LS-means for an effect that is related to a covariate, you can use the AT option in the LSMEANS statement, available in the GLM, MIXED, GENMOD, and many other modeling procedures. By default, all continuous covariates are set at their means when computing LSMEANS. For details, see "Construction of Least Squares Means" in the description of the LSMEANS statement. You can modify the values used for continuous covariates with the AT option. To avoid extrapolating outside the range of the data, the values specified in the AT option should generally be within the observed range.

Consider the following data set.

     data test;
        input trt $ x y;
        datalines;
      A  10.3928  20.469
      A  1.0304    2.242
      A  4.0038   10.384
      A  19.6831  38.936
      A  12.2837  25.062
      B  25.8380  80.616
      B  5.6191   20.881
      B  25.3164  77.252
      B  10.0879  31.314
      B  27.0792  85.066
      C  27.6587 113.275
      C  15.8211  67.454
      C  6.9228   31.015
      C  11.5046  49.103
      C  10.2614  44.924
      ;

The following LSMEANS statements compute LS-means for each level of TRT at x=10, the mean of X which is the default if AT is omitted, and x=20. Note that these values are within the observed range of X in the data. The PDIFF option produces multiple comparisons among the TRT levels at these covariate values.

     proc mixed data=test;
        class trt;
        model y = trt x*trt / noint;
        lsmeans trt / at x=10  pdiff; 
        lsmeans trt / at means pdiff;
        lsmeans trt / at x=20  pdiff; 
        run;

Following are the results of the LSMEANS statements.