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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.