Programming the statistical procedures from SAS

Proc Logistic: EffectPlot

Occasional Contributor
Posts: 11

Proc Logistic: EffectPlot

Hi All,

My doubt concerns the plot generated by the EffectPlot statement in the Proc Logistic procedure.

When I run the code below

ods graphics on;

proc logistic data=test plots(only maxpoints=none)=(roc) ;

model VDEP (event='1')= VINDEP1 VINDEP2  / RSQ lackfit ctable pprob=0.5 ;

score out=test_est;

effectplot fit(x=VINDEP2) / AT(VINDEP1=0.35);


ods graphics off;

The effectplot statement generates the plot below.


My question is: What are the values that are plotted at '0' and '1' of the predicted probability?

Because when I look at the predicted probabilities in the table produced by the Score statement, values remain between 0.04 and 0.3 .

In fact when I run

proc sql;
create table sgploteste as
select distinct test_est.*
from test_est
WHERE round(VINDEP1,0.01)=0.35;

proc sgplot data=sgploteste;
scatter x=VINDEP2 y=P_1;
xaxis values=(0 to 720 by 30);
yaxis values=(0 to 1 by 0.2);

I get the plot below.


I just don't get what am I missing.

Thanks in advance for your help.


Grand Advisor
Posts: 10,069

Re: Proc Logistic: EffectPlot

Since you apparently are restricting both graphs to values of VINDEP1 to 0.35 I would suspect that the values you ask about occur 1) when VINDEP1 is some other value or 2) not with your data in the range of values given for VINDEP2 for the model. You might try providing additional value to extend the range for VINDEP2 and VINDEP1=0.35 without values for VDEP to see if the predicted values show up for them.

Valued Guide
Valued Guide
Posts: 679

Re: Proc Logistic: EffectPlot

The values at 0 and 1 are your OBSERVED values (with 1 for event and 0 for nonevent) at the different values of your predictor. The graph looks like you do not have much separation based on VINEP2. See the LOGISTIC User's Guide for examples of this plot.

Occasional Contributor
Posts: 11

Re: Proc Logistic: EffectPlot


In fact I did read some information in ( ,, but didn't saw that the observed values where also displayed in the plot, I thought that only the predicted probabilities and the independent variable value where displayed.

The closest example I found was output 51.7.4  in
where I see some dots but didn't know what they were.

Concerning your helpful observation 'The graph looks like you do not have much separation based on VINEP2'. Can you please elaborate? (I'm having some problems in what statistics to use to choose my independent variables, I know that I shouldn't use an automatic stepwise, and your observation has led me to think that I can take more information of this plot that I was thinking )

Thanks again.

Valued Guide
Valued Guide
Posts: 679

Re: Proc Logistic: EffectPlot

The one example you showed was for binomial data with data in the form of events/trials, or y/n. y events out of n in each experimental or observational unit. You have binary data (a special case of binomial), so your values are just y (n=1). You can have either a 0 or 1 for each observation. Hence the graph has a bunch of points at 0 and 1. Ideally, you want most of the 1s on the right and the 0s n the left. But you have lots of points across the X values. Further help is more than I can give in this forum. You should read the book Logistic Analysis Using SAS book by Allison. It is excellent.

Occasional Contributor
Posts: 11

Re: Proc Logistic: EffectPlot

Thanks for your help. Now it's clear for me what you meant. And I will follow your book recommendation.

(Sorry I don't know why but the option to tag your answers as corrects is not available)

Ask a Question
Discussion stats
  • 5 replies
  • 3 in conversation