Data visualization with SAS programming

Regression graphics

Reply
New Contributor
Posts: 4

Regression graphics

I am using Proc REG and using plots=predictions(x=SMQ720) statement. I just want the graph that shown predicted values and smq720 on x-axis. How to just create that graph only and save it in a library. Also, can I craete the same graph if I use SURVEYREG?

 

Ram Jain

Super Contributor
Posts: 252

Re: Regression graphics

Hi Ram,

 

You can use the below code as an example to help you. In the quotes within ods listing gpath, put the output folder that you want the output to go to.

 

ods listing gpath = "yourdestination";
ods select predictionpanel;
proc reg data = sashelp.cars plots = prediction(x=weight);
model horsepower = weight;
run;

 

 

 

ODS TRACE ON was used to find the names of the outputs in Proc Reg, and then ODS SELECT was used to just select the prediction plots. Another alternative you could use is to output the dataset using output out statements and then plot the graph. 

 

Thanks

New Contributor
Posts: 4

Re: Regression graphics

Thank you so much. Predicton panel is still a two-part. First part is predicted values plotted against X and second part is residuals plotted against X. Is there a way to just plot the first part. Can we do the same if using Proc Surveyreg?

 

Ram Jain

Super Contributor
Posts: 252

Re: Regression graphics

You're welcome. Instead of ods select Predictionpanel try using this instead ods select FitPlot;

I'm not sure about Proc Surveyreg but the procedures should be similar. Either use ods select to select the plot you want, or output the dataset using output out = data and then plot the graph, and then output the graph as before using ods listing gpath.

 

Thank you.

Ask a Question
Discussion stats
  • 3 replies
  • 288 views
  • 0 likes
  • 2 in conversation