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
LOG(MEAN(a=1)/MEAN(a NE 1)) AS woe,
COUNT(*) AS size
GROUP BY o
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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.