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.
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;
Mr.Ksharp
Thank you for your answer.
You showed the program in detail.
It helps me very useful.
Once again, thanks a lot.
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.
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!
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.
Ready to level-up your skills? Choose your own adventure.