SAS Optimization, and SAS Simulation Studio

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-17-2007 03:55 PM

Say O2=O*O

proc logit data = X descending;

model A = O O2 P Q;

output out = Y p=pred xbeta=logit;

run;

I want to plot a graph that can show the relationship between the probablity of A and O is a 'U' shape. How can I do this? Thanks!

proc logit data = X descending;

model A = O O2 P Q;

output out = Y p=pred xbeta=logit;

run;

I want to plot a graph that can show the relationship between the probablity of A and O is a 'U' shape. How can I do this? Thanks!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to deleted_user

11-27-2007 02:06 PM

You have to compute LOG(Prob(A=event|O)/Prob(A=non-event|O)) to draw it against the values of O. This quantity is known as Weight of Evidence (WoE) or log-odds. It is this quantity that is modelled in a similar fashion as Y in a linear regression : the logistic model is WoE = Xb.

Since those probabilities can be computed as means, you just have to type the right "event" value for A (I assume it is 1 in the following code).[pre]

PROC SQL ;

CREATE TABLE work.graph AS

SELECT o,

LOG(MEAN(a=1)/MEAN(a NE 1)) AS woe,

COUNT(*) AS size

FROM X

GROUP BY o

;

QUIT ;

PROC GPLOT DATA = work.graph ;

BUBBLE woe * o = size ;

RUN ; QUIT ;[/pre]

If this graph shows a U-shaped relationship between A and O, it will be a good reason to include O2 in the model.

Regards.

Olivier

Since those probabilities can be computed as means, you just have to type the right "event" value for A (I assume it is 1 in the following code).[pre]

PROC SQL ;

CREATE TABLE work.graph AS

SELECT o,

LOG(MEAN(a=1)/MEAN(a NE 1)) AS woe,

COUNT(*) AS size

FROM X

GROUP BY o

;

QUIT ;

PROC GPLOT DATA = work.graph ;

BUBBLE woe * o = size ;

RUN ; QUIT ;[/pre]

If this graph shows a U-shaped relationship between A and O, it will be a good reason to include O2 in the model.

Regards.

Olivier