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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1555 views
  • 0 likes
  • 2 in conversation