BookmarkSubscribeRSS Feed
RamJ
Calcite | Level 5

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

3 REPLIES 3
djrisks
Barite | Level 11

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

RamJ
Calcite | Level 5

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

djrisks
Barite | Level 11

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 903 views
  • 0 likes
  • 2 in conversation