BookmarkSubscribeRSS Feed
kokodenden52
Obsidian | Level 7

Oversampling is introduced below as a method of building a model when the number of targets is extremely small.

 

The method by Enterprise Miner is introduced below,

Could it be done by writing program?

 

https://www.sas.com/offices/asiapacific/japan/service/technical/faq/list/body/em003.html

 

 

Sorry to trouble you, but please tell me.

3 REPLIES 3
Ksharp
Super User
data have;
 set sashelp.heart;
run;
proc sort data=have;by status;run;
/*Check population ratio of Dead and Alive*/
proc freq data=have;
table status/missing;
run;

/*If you want oversample 1:1 for Dead and Alive*/
proc surveyselect data=have out=want sampsize=(1000 1000);
strata status;
run;

/*Check the oversample rate*/
proc freq data=want;
table status/missing;
run;
kokodenden52
Obsidian | Level 7

Mr.Ksharp

 

Thank you for your answer.

 

You showed the program in detail.

It helps me  very useful.

 

Once again, thanks a lot.

PGStats
Opal | Level 21

If you want oversampling, i.e. to sample more units than there are in the dataset, you will need to add option

 

method=urs

 

to the proc surveyselect statement of @Ksharp code above. URS means unrestricted random sampling, i.e. sampling with replacement. By default, proc surveyselect does SRS: simple random sampling which is sampling without replacement.

PG

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1695 views
  • 2 likes
  • 3 in conversation