Obsidian | Level 7

## Predicted probability graphic fitted curve/confidence interval.

I've been told I need to have just the fitted curve and confidence interval in my graphic, not all the data points. I have literally no idea how to do it.

This is my code to make the predicted probablity graphic, and it's attached as a pdf.

``````proc glm data=teen.obdata;
weight p_teenpreg;
store intmodel;
run;
quit;
proc plm source=intmodel;
score data=teen.obdata out=_temp1_ predicted / ilink;
run;
ods listing gpath="\\Mac\Home\Desktop";
ods graphics / imagename="small" imagefmt=png;
proc sgplot data = _temp1_;
series x = minroadmiles y = predicted / group = rural;
yaxis label = "Predicted Probability of Adverse Birth Outcomes";
xaxis values= (0 5 10 15 20 25 30 35 40) label = "Miles";
title “Predicted Probability by Road Miles”;
run;
title;
ods graphics off;``````

3 REPLIES 3
SAS Super FREQ

## Re: Predicted probability graphic fitted curve/confidence interval.

Can you post the output of "proc contents data=_temp1_; run;"?

Obsidian | Level 7

attached!

SAS Super FREQ

## Re: Predicted probability graphic fitted curve/confidence interval.

The problem is that your model has covariates, so plotting the predicted values against one of the covariates (minroadmiles) does not result in a smooth curve. You can use the EFFECTPLOT statement in PROC PLM to produce a sliced fit plot, which enables you to visualize a slice through the regression surface. For more discussion and examples, see Visualize multivariate regression models by slicing continuous variables.

Discussion stats
• 3 replies
• 307 views
• 1 like
• 3 in conversation