BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
degdeg
Calcite | Level 5

Hi,

 

i try to use the oversampling technique with PROC SURVEYSELECT.

 

I have a sample of 8500 obersvations with 1% of 0 and 99% of 1.

 

I achieved undersampling by droppings 1 but now i want to inflate the percentage of 0 with oversampling.

 

So i tried with PROC SURVEYSELECT to have a random sample of, for example, 12.5% of 0 and 87.5% of 1 with the URS method but he can't do a random sample greater with a number of 0 greater than in the original sample.

 

For example, i got like 99 times 1 and 1 time 0. What i want is to have like still 99 times 1 but 10 times 1 in my new sample, is it impossible with PROC SURVEYSELECT ? 

 

Thanks you by advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
data have;
 set sashelp.class ;
run;
proc sort data=have;by sex;run;
proc surveyselect data=have out=want method=urs sampsize=(100 100)  outhits;
strata sex;
run;

View solution in original post

2 REPLIES 2
Ksharp
Super User

Can you use TWO proc surveyselect to sample for these two level 0,1

and after that combine them together by

data want;

 set a b;

run;

 

 

or try this one.

data have;
 set sashelp.class ;
 size=1;
run;
proc sort data=have;by sex;run;
proc surveyselect data=have out=want method=pps_wr sampsize=(100 100)  outhits;
strata sex;
size size;
run;
Ksharp
Super User
data have;
 set sashelp.class ;
run;
proc sort data=have;by sex;run;
proc surveyselect data=have out=want method=urs sampsize=(100 100)  outhits;
strata sex;
run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 8092 views
  • 0 likes
  • 2 in conversation