Statistical Procedures

Programming the statistical procedures from SAS
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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