BookmarkSubscribeRSS Feed
BlueNose
Quartz | Level 8

Dear all,

 

I have data containing one dependent variable, I'll call it Y for simplicity, and let's assume it is normally distributed.

 

I have independent variables X1, X2, X3, X4. All of them are ordinal, getting values of 1-4, where 4 is highest and 1 lowest. In addition, I have some covariates, such as age, gender, etc...

 

I wish to model Y vs. the independent variables and the covariates, but I am mostly interested in finding if there are significant differences between groups 1 and 4 of each independent variable.

 

Using the following code:

 

PROC GLM DATA = Dat;
    CLASS X1;
    MODEL Y = X1 Age Gender ;
    LSMEANS X1 / cl pdiff diff;
RUN;

Gives me a linear model, with multiple comparisons of all pairs of the variable X1.

 

Is there a better way to model in this situation ? Is there a way to define something like a contrast, so only groups 1 and 4 will be compared with higher power ? Is my code correct in the first place ?

 

Thank you in advance !

1 REPLY 1

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 1 reply
  • 2019 views
  • 0 likes
  • 2 in conversation