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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: