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!
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.
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...
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.