using trt , covar as the covariate and dmi as the dependent variable, was homogeneity of slopes met?
*below is the text file data diet.txt*
cow trt block covar dmi weeks 747 4 4 22.4757 24.4895 14 755 5 5 24.5157 26.7524 14 819 4 3 22.1100 25.4132 8 835 3 10 18.9529 27.6605 14 849 5 2 20.0657 17.0912 14 850 2 8 21.0600 26.4908 14 852 1 6 23.8933 27.8113 13 855 3 2 27.0329 27.0967 14 869 3 5 25.0800 25.1205 14 872 1 10 21.4414 27.7596 12 890 5 6 24.6457 23.7472 14 894 6 9 23.7971 26.0426 13 1549 4 8 21.8886 25.1794 14 3135 1 9 18.7286 21.4793 14 3164 2 2 19.5083 22.6606 12 3231 5 4 18.5886 23.0251 14 3240 2 7 19.8500 27.5362 14 3353 1 4 . 24.7224 14 3366 5 1 20.1900 24.2389 14 3372 4 9 23.5571 27.1255 14 3408 6 1 20.2600 23.9520 14 3440 1 8 19.2750 26.2302 14 3455 4 5 17.0886 24.9188 14 3460 3 9 20.4257 25.1809 14 3466 2 3 24.6114 28.0106 14 3467 4 1 14.8033 22.9552 14 3471 1 1 16.9200 24.3709 14 3478 6 3 23.4171 22.9222 14 3499 1 2 22.0329 26.2007 14 3508 3 1 27.0543 32.9527 14 3520 6 6 23.3329 27.4932 14 3527 6 4 20.9614 23.8124 14 3528 2 9 18.5557 23.3623 14 3529 5 10 20.4143 25.1781 14 3531 2 1 20.8167 24.6142 14 3542 2 6 25.7871 28.0095 14 3561 2 4 25.6457 26.9496 14 3564 5 9 23.8586 27.8948 14 3580 3 4 22.4071 24.8609 14 3586 4 2 24.5700 24.9605 14 3589 6 7 15.9386 22.3435 14 3593 1 5 21.6429 24.2462 14 3594 3 3 . 24.9867 12 3595 2 5 19.0300 28.0241 14 3596 6 5 27.1671 27.2993 14 3598 6 2 21.5667 25.4685 14 3604 4 10 20.8714 26.6923 14 3605 1 3 19.7671 28.1831 14 3611 3 6 18.5186 23.6910 14 3613 3 8 24.3829 26.6503 14 3615 5 7 22.8329 25.3444 14 3622 4 7 19.0857 22.9824 14 3623 6 10 19.0486 23.3875 14 3624 4 6 21.3286 21.6679 14 3629 3 7 18.5771 18.9699 14 3630 6 8 24.1200 26.3490 7 3643 2 10 17.6314 23.7072 14
How do I test for homogeneity of slopes in SAS 9.4?
This can be done as described generally in this note and in the example note that it links to. In this case, the test for the trt*covar interaction is a test of the equality of slopes - if significant, that suggests that the slopes differ. If not, then the interaction can be dropped and the covar estimate is the estimated common slope.
proc glm;
class trt;
model dmi=trt covar covar*trt / noint solution;
run; quit;
This can be done as described generally in this note and in the example note that it links to. In this case, the test for the trt*covar interaction is a test of the equality of slopes - if significant, that suggests that the slopes differ. If not, then the interaction can be dropped and the covar estimate is the estimated common slope.
proc glm;
class trt;
model dmi=trt covar covar*trt / noint solution;
run; quit;
Thank you!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.