BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
nyc1989
Calcite | Level 5

I've conducted a multivariable logistic regression to assess the impact of various characteristics (demographics, region, disease) on the continuous outcome- days spent in hospital. I'm interested in looking at the Q1 and Q3 quartile information of the adjusted estimate for each of the cohorts I'm looking at. What is the best way to do that?

 

I can't seem to find how to add that within the ls means statement

 

proc logistic data= data;
class gender race education cancer heart_failure cohort
model days= cohort gender age race cancer heart_failure  education;
lsmeans cohort;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

I think you are going to have to export a dataset with all of the predicted values for each observation, and then post-process that dataset (probably with PROC MEANS or SUMMARY) to get the quantile estimates.  I suppose my question on this approach would be: why not do that with the raw data?

 

The other possibility is to use an option on the LSMEANS statement, with ALPHA=0.25 and CL.  That should give the 25th percentile as the lower bound and the 75th percentile as the upper bound.  From there you can post-process as needed.

 

SteveDenham

View solution in original post

3 REPLIES 3
Reeza
Super User
I think you want the ESTIMATE or ODDSRATIO statement though I'm drawing a blank on the Q1/Q3 quartile portion of that statement.
SteveDenham
Jade | Level 19

I think you are going to have to export a dataset with all of the predicted values for each observation, and then post-process that dataset (probably with PROC MEANS or SUMMARY) to get the quantile estimates.  I suppose my question on this approach would be: why not do that with the raw data?

 

The other possibility is to use an option on the LSMEANS statement, with ALPHA=0.25 and CL.  That should give the 25th percentile as the lower bound and the 75th percentile as the upper bound.  From there you can post-process as needed.

 

SteveDenham

nyc1989
Calcite | Level 5

Thanks the lsmeans alpha solution worked!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 606 views
  • 2 likes
  • 3 in conversation