BookmarkSubscribeRSS Feed
BN_RN17
Calcite | Level 5

Hello,

I initially built a logistic model for my dataset, and used the score option within proc logistic to get a probability of the event for each observation. I would like to use proc genmod (with binomial distribution, logit link) so I can use the bayes option with coeffprior= in order to get coefficients based on a categorical variable.

The issue - I don't know how to get the probability of the event for each observation within proc genmod. How can I do something like the score option within proc logistic?

Thanks!

4 REPLIES 4
stat_sas
Ammonite | Level 13

Hi,

You need to use ods with obstats option something liket this.

ods output obstats=obstats;

PROC GENMOD DATA=have;

MODEL Y=X / D=B OBSTATS;

RUN;

proc print data=obstats;

run;

BN_RN17
Calcite | Level 5

Thank you for your response. Gave that a try, but the proc print tells me there's no dataset called obstats. In the line: ods output obstats=obstats, the obstats does not become blue as a recognized option.

stat_sas
Ammonite | Level 13

Are you putting obstats in model options?

MODEL Y=X / D=B OBSTATS;

BN_RN17
Calcite | Level 5

Yes, I put that in. Actually, I just realized I got a note too

NOTE: The OBSTATS, RESIDUALS, XVARS, PREDICTED, and DIAGNOSTICS options are ignored for a Bayesian analysis.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 1597 views
  • 0 likes
  • 2 in conversation