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!
means ecl_nosmoke_cat/lines t;
allows the pairwise comparison of the mean via a t-test.
On top of the answer by @PaigeMiller ,
you might want to :
Thanks,
Koen
@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?
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
Thank you both! I was able to figure it out with your advice and some help from my advisor.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.