BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Daniellekeem
Fluorite | Level 6

Hello, 

I am carrying on a project that is about to have predicted probability and would like to ask you several questions.

1. To see whether there is relationship between age and health outcome, I did logistic with spline effect as followed then have sgplot.

PROC LOGISTIC DATA=HI PLOTS=NONE;

  EFFECT SPL= SPLINE(AGE95/DETAILS NATURALCUBIC BASIS=TPF(NOINT) KNOTMETHOD=PERCENTILES(5) );

  MODEL HEALTH (EVENT=‘1’)= SPL;

  OUTPUT OUT=SPLINE_HEALTH PREDICTED =PREDPROB; QUIT;

PROC SGPLOT DATA= OUT=SPLINE_HEALTH NOAUTOLEGEND;

  SCATTER SCATTER X=AGE95 Y=HEALTH(EVENT=‘1’) / JITTER

  SERIES SCATTER X=AGE95 Y=PREDPROB;

   YAXIS MIN=0 MAX=1 GRID LABEL=“PREDICTED PROBABILITY”; RUN;

Then I also want to have CI on the graph using band statement but it does not give me what I wanted for (e. g. attach 1 from SAS/STAT® 14.1 User’s Guide The GAMPL Procedure p. 2918). Can you recommend what I need do for CI on a graph? 

 

2. The other method I am doing is non-parametic with proc adaptivereg 

PROC ADAPTIVEREG DATA=HI_2;
	MODEL HEALTH (EVENT=‘1’)=AGE95;
	OUTPUT OUT METABOLIC P(ILINK); RUN; 

PROC SGPLOT DATA=METABOLIC NOAUTOLEGEND;
	SCATTER X=AGE95 Y=HEALTH / JITTER;
	SERIES X=AGE95 Y=PRED;
	YAXIS MIN=0 MAX=1 GRID LABEL=“PREDICTED PROBABILITY”; RUN; 

Here, again I would like to have CI on the graph but it has been challenging. 

Is it because Ci cannot be calculated or is it me not to have CI? 

Please let me know how to deal with this issue. 

 

Many thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

For an example of using the EFFECTPLOT statement and PROC LOGISTIC to create a fit plot with CLs, see the section "A logistic model with a continuous-continuous interaction" in the article "Use the EFFECTPLOT statement to visualize regression models in SAS" 

The example shows a panel of plots, but if you omit the PLOTBY= option, you will get a single plot.

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

ODS Graphics from PROC LOGISTIC produces a fitted plot with confidence intervals of the predicted values, but this does not contain a scatterplot of the raw data. The specific graph you want is the EFFECTPLOT.

 

See the plot all the way at the bottom at https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_logistic_examples07.htm&docsetVer...

--
Paige Miller
Rick_SAS
SAS Super FREQ

For an example of using the EFFECTPLOT statement and PROC LOGISTIC to create a fit plot with CLs, see the section "A logistic model with a continuous-continuous interaction" in the article "Use the EFFECTPLOT statement to visualize regression models in SAS" 

The example shows a panel of plots, but if you omit the PLOTBY= option, you will get a single plot.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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