BookmarkSubscribeRSS Feed
jesspurse
Obsidian | Level 7

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;
model p_adverse=minroadmiles miles_sq rural rural*miles_sq;
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
DanH_sas
SAS Super FREQ

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

Rick_SAS
SAS Super FREQ

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.

 

Also see, "3 ways to add confidence limits to regression curves in SAS."

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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