BookmarkSubscribeRSS Feed
viva0521
Fluorite | Level 6

Hello,

I have following code running in SAS,

 

proc adaptivereg data=imported_excel
SEED = 123
PLOTS = ALL
details=bases;
partition fraction(validate=0.25 test=0.25);
model Y = A B C;
RUN;

 

is there anyway I can output the partition dataset, test,validate, respectively? Thanks.

5 REPLIES 5
Reeza
Super User

Ok...I tried to run it to check, but it keeps crashing in SAS Studio.

 

If you generate an OUTPUT data set, does it contain a _ROLE_ variable that denotes what each observation was categorized?

You can generate the OUTPUT data set using something like

 


   output out=dataset_role;

 

If you have partitioned the input data by using a PARTITION statement, then a character variable _ROLE_ is included in the output data set. For each observation the value of _ROLE_ is as follows:
_ROLE_ Observation
TEST Testing
TRAIN Training 
VALIDATE Validation
viva0521
Fluorite | Level 6

Reeza, 

 

Thanks for your reply. 

 

I did your suggestion, but no data set was generated. Where should I insert "output out=dataset_role" to my model? Thanks. 

 

Reeza
Super User
proc adaptivereg data=imported_excel 
SEED = 123 
PLOTS = ALL
details=bases;
partition fraction(validate=0.25 test=0.25);
model Y = A B C;
output out=dataset_role;
RUN;

If this doesn't work post your log. I ran it using the example in the documentation and it worked fine.

 

 https://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_adaptivereg...

viva0521
Fluorite | Level 6

Reeza,

 

Thanks for your reply. It does work, but I still got one question. So I am using 25% of the whole dataset as "test", the number of observations in my whole data set is 816, literally I should get 204 "test" observations. However, I found there were 211 observations pulled out as "test" with the code above, is there anything wrong with this? Not a big deal, just curious, thanks! 

Reeza
Super User

No idea, I would consider passing that on to Tech Support. 

sas-innovate-2024.png

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.

 

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
  • 5 replies
  • 1104 views
  • 0 likes
  • 2 in conversation