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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 2026 views
  • 2 likes
  • 3 in conversation