BookmarkSubscribeRSS Feed
talktorob
Calcite | Level 5

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.

 
I obtain estimates when I run the code below. However, I have not interpreted estimate statements in quite some time.
 
Question: Could someone please review the code below and assess whether this outputs the table shell data correctly?
 
proc surveyreg data=Analyze;
cluster psu2; 
stratum strata2;
weight weight2;
domain  keep2('1');
 
class acescore female ethnic incgt30k1 hsedu married insurance1 engpref1 nativity ;
 
model sbpchangemed = acescore age1 followuptime2 female ethnic incgt30k1 hsedu married insurance1 engpref1 nativity bmi1 sbp1med hsiscore acescore*hsiscore /solution clparm anova;
 

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;

 
Table 3 screenshot.jpg

5 REPLIES 5
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
talktorob
Calcite | Level 5

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.

 

proc surveyreg data=Analyze;
cluster psu2; 
stratum strata2;
weight weight2;
domain  keep2('1');
class acescore female ethnic incgt30k1 hsedu married insurance1 engpref1 nativity ;
 
model sbpchangemed = acescore age1 followuptime2 female ethnic incgt30k1 hsedu married 
                                            insurance1 engpref1 nativity bmi1 sbp1med hsiscore acescore*hsiscore /solution clparm anova;
 
estimate "1 vs 0 hsiscore =2" acescore -1 1 0 0 0 hsiscore 2 age1 41.5 followuptime2 5.8 female 0 1 ethnic 1 2 3 4 5 6 7 incgt30k1 0 1 2 hsedu 0 1 married 0 1                                                                                                                                         insurance1 0 1  engpref1 0 1 nativity 1 2 3 bmi1 29.5 sbp1med 121.5 hsiscore 13.6 ; 
 
run;
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
talktorob
Calcite | Level 5

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 

 

proc surveyreg data=Analyze;
cluster psu2; 
stratum strata2;
weight weight2;
domain  keep2('1');
class acescore female ethnic incgt30k1 hsedu married insurance1 engpref1 nativity ;
 
model sbpchangemed = acescore age1 followuptime2 female ethnic incgt30k1 hsedu married 
insurance1 engpref1 nativity bmi1 sbp1med hsiscore acescore*hsiscore /solution clparm anova;
 
lsmeans acescore  / at hsiscore =2   age1 followuptime2 female 0 1 ethnic 1 2 3 4 5 6 7 incgt30k1 0 1 2 hsedu 0 1 married 0 1 insurance1 0 1 
engpref1 0 1 nativity 1 2 3 bmi1 sbp1med ;
run ;
PaigeMiller
Diamond | Level 26

The link I gave has actual examples of a situation where more than one covariate is present.

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 545 views
  • 0 likes
  • 2 in conversation