BookmarkSubscribeRSS Feed
Corinthian94
Obsidian | Level 7

Hi all, 

 

I have a dataset I'm performing an analysis on with a continuous outcome and categorical exposure that is parsed into 5 quintiles. I'm looking to compare the mean value of the outcome in each quintile to each other statistically but am unsure on the best way to do this in SAS. Would anyone have some advice on this? I used the following code to attain the means across quintiles for the outcome variable but have not been able to figure out how to compare them.

 

proc glm data=thomas.ecl_analytic;

    class ecl_nosmoke_cat;

    model weight_change_kg = ecl_nosmoke_cat;

    means ecl_nosmoke_cat;

run;

 

Thank you in advance for the help!

5 REPLIES 5
PaigeMiller
Diamond | Level 26
means ecl_nosmoke_cat/lines t;

allows the pairwise comparison of the mean via a t-test.

--
Paige Miller
sbxkoenk
SAS Super FREQ

On top of the answer by @PaigeMiller ,

 

you might want to :

  • check the Statistical Assumptions for Using PROC GLM
  • ... like requesting a homogeneity of variance test
  • use LSmeans instead of arithmetic means
  • correct for the inflation of the type I ERROR probability when doing multiple comparisons (I do not think the t option for performing pairwise t tests is doing that automatically).

 

Thanks,
Koen

PaigeMiller
Diamond | Level 26

@sbxkoenk wrote:

On top of the answer by @PaigeMiller ,

 

you might want to :

  • check the Statistical Assumptions for Using PROC GLM
  • ... like requesting a homogeneity of variance test
  • use LSmeans instead of arithmetic means
  • correct for the inflation of the type I ERROR probability when doing multiple comparisons (I do not think the t option for performing pairwise t tests is doing that automatically).

 

Thanks,
Koen


Three good points, and one I am skeptical of. For a one-way design, are not the means and LSMeans equal?

--
Paige Miller
sbxkoenk
SAS Super FREQ

Three good points, and one I am skeptical of. For a one-way design, are not the means and LSMeans equal?

I may be completely mistaken, but in case there are missing data (missing values), I think Means and LSMeans differ (even for a one-way design). 
No time to test it thoroughly now, so definitely not for blindly taking it for granted !!

But it is a fact, indeed, that increasingly complex treatment arrangements and experimental designs and also covariates being present (ANCOVA) gives more reason to use LS-means, rather than ordinary means.
And a one-way design is not exactly 'complex'.

 

Thanks,

Koen

Corinthian94
Obsidian | Level 7

Thank you both! I was able to figure it out with your advice and some help from my advisor.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1384 views
  • 2 likes
  • 3 in conversation