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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of 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
  • 1608 views
  • 0 likes
  • 2 in conversation