Greetings,
I am trying to estimate the means of a continuous outcome called 'sbpchangemed' at different levels of a categorical variable (called acescore with 5 levels) (exposure) at three different values of a continuous variable (called hsiscore). I found the mean within each tertile of hsiscore. Tertile 1, low, has a mean of 2.0. Tertile 2, medium, has a mean of 10.3, and Tertile 3, high, has a mean of 29.5.
I would like to estimate the change in sbpchangemed by acescore at a hsiscore of 2, a hsiscore of 10.3, and a hsiscore of 29.5. I have added the table shell below for context.
estimate "1 vs 0 hsiscore =2" acescore -1 1 0 0 0 hsiscore 2 ;
estimate "2 vs 0 hsiscore =2" acescore -1 0 1 0 0 hsiscore 2 ;
estimate "3 vs 0 hsiscore =2" acescore -1 0 0 1 0 hsiscore 2 ;
estimate "4+ vs 0 hsiscore =2" acescore -1 0 0 0 1 hsiscore 2 ;
estimate "1 vs 0 hsiscore =10.3" acescore -1 1 0 0 0 hsiscore 10.3 ;
estimate "2 vs 0 hsiscore =10.3" acescore -1 0 1 0 0 hsiscore 10.3 ;
estimate "3 vs 0 hsiscore =10.3" acescore -1 0 0 1 0 hsiscore 10.3 ;
estimate "4+ vs 0 hsiscore =10.3" acescore -1 0 0 0 1 hsiscore 10.3 ;
estimate "1 vs 0 hsiscore = 29.5" acescore -1 1 0 0 0 hsiscore 29.5 ;
estimate "2 vs 0 hsiscore = 29.5" acescore -1 0 1 0 0 hsiscore 29.5 ;
estimate "3 vs 0 hsiscore = 29.5" acescore -1 0 0 1 0 hsiscore 29.5 ;
estimate "4+ vs 0 hsiscore = 29.5" acescore -1 0 0 0 1 hsiscore 29.5 ;
run;
In my view, when the coefficients of an ESTIMATE statement are all ±ones or zeros, then there really is no need to use an ESTIMATE statement at all, the LSMEANS statement will do the job, with much less programming effort. And since the LSMEANS statement has the AT= option for setting the value of a covariate, it seems to meet your needs here.
Dear Paige,
Thank you for your feedback.
I am trying to include all the co-variates from the model statement in the estimate statement as well. Some of those coefficients are not 0 or 1.
Is the estimate statement appropriate for this analysis?
When I run the code below, the estimate statement does not output any result. Can you advise on the structure of the estimate statement?
Thanks for your help.
It seems as if you have ignored my advice to use LSMEANS, and it seems as if you didn't look at the AT= option for setting values of covariates in LSMEANS as explained in the documentation I linked to. Please try LSMEANS and not ESTIMATE for this situation.
Hi Paige,
How do you add other covariates in the lsmeans statement? In addition to setting hsiscore=2, I would like to include the other model covariates in the lsmeans
The link I gave has actual examples of a situation where more than one covariate is present.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.