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
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
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
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.