in variable selection method to choose the best subset of models. How can I create a plot for cp with p and r adj with p
here is my code for all possible regressions
proc reg data=salary;
model y=x1 x2 x3 x4 x5 x6 x7 x8 x9 x10/
selection=rsquare cp mse adjrsq aic bic best=10 b;
There are two concepts you need to learn.
1. How to capture data from SAS procedures into data sets:
2. How to graph:
I've posted answers to your questions that was fully coded and illustrated this, and you've posted several questions that are pretty much all examples of this procedure. It's worth spending the day or so to learn these two topics well enough.
Your code currently is a mix of PROC REG and GPLOT, and by that I mean you've mixed up procedures entirely. I do not see a GPLOT statement at all in your code though. I do not use GPLOT so cannot comment on that portion. The general recommendation these days is to not use GPLOT, it's to use SGPLOT because it's easier, graphics are higher quality and there are more graph types and options to customize it.
goptions ctitle=black htitle=3.5pct ftitle=swiss
ctext =magenta htext =3.0pct ftext =swiss
cback =ligr border;
symbol1 v=circle c=red h=1 w=2;
title 'Cp Plot with Reference Lines';
proc reg data=salary;
model salary=x1 x2 x3 x4 x5 x6 x7 x9 x10
/ selection=rsquare noprint;
/ chocking=red cmallows=blue
vaxis=0 to 15 by 5 cframe=ligr;
I wrote this code and it give me error
Which part? What did you try?
You need to break these down into steps and then try and solve each step individually. If you try and do it all at once you will not get anywhere.
The steps are:
1. Get data from PROC REG into a data set
2. Graph with SGPLOT - customize after base plot is obtained.
FYI - I am more than happy to help but I'm not going to write the code for you - my personal choice. Someone else may, if that's what you want, you can wait and see if someone else responds.
I couldnot figure it out 😞
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.