BookmarkSubscribeRSS Feed
magsbennett
Calcite | Level 5
Hello

I have run an ancova to test if the slopes of my regression lines were different and they were. Where I am stuck is that the pairwise comparison of the interaction term isn't being allowed since the independent variable isn't a class variable (lsmeans x*covariate/ adjust=tukey pdiff).

Can anyone help me perform pairwise comparisons on the interaction term please?

Also is there a way to test if each of the different regression lines that are created by the covariate are different from 0 in the ancova design instead of running separate regressions?

Thanks!
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
The theory underlying the Tukey test doesn't translate to the case of a continuous covariate. I'm not sure that the others do either (though looked at the original papers of some of them).

You can, in GLM, test the pairwise comparisons using the CONTRAST statements and address multiple comparisons using Bonferroni.

You can use the CONTRAST statement to examine the regression lines as well.

Doc Muhlbaier
Duke
Susan
Calcite | Level 5
You can reparameterize the model to easily get what you want.

Let y be response.
Let a be the categorical predictor with 3 levels.
Let x be the continuous predictor.

In this parameterization, the interaction a*x gives you a test of whether slopes are equal:

proc glimmix data=your_data;
class a;
model y = a x a*x / solution;
run;

This parameterization reports the intercept and the slope estimates for the linear regression each level of a:

proc glimmix data=your_data;
class a;
model y = a a*x / noint solution;
/* Pairwise comparison among slopes, with stepdown Bonferroni adjustment */
estimate "Slope A1 versus A2" a*x 1 -1 0,
"Slope A1 versus A3" a*x 1 0 -1,
"Slope A2 versus A3" a*x 0 1 -1
/ adjust=bon stepdown;
run;

Check the GLIMMIX documentation for details, including ADJUST= alternatives. I haven't tested this code so there could be syntax errors.

The book by Milliken and Johnson (Analysis of Messy Data, Vol III: Analysis of Covariance) covers ANCOVA extensively. I think there's also info in Littell et al. (SAS System for Mixed Models, 2nd ed).

Have fun!
Susan In the second parameterization, the fixed-effects solutions will report tests of whether estimates are zero--in other words, whether each intercept or slope is equal to zero.


Message was edited by: Susan

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 9986 views
  • 0 likes
  • 3 in conversation