Hello everyone, I have a problem that is rather specific and I cannot find any option to solve it: I have two datasets: reference_data application_data with both having been binned by the same method. The respective bin for each row is stored in a column called "Bin". Furthermore I have a variable called "Flag" which can take on either 0 or 1, whereas the majority of data is set to 0 (since 1 is considered to be an outlier and thus rare but important). Example reference_data set: Var1 | Var2 | ... | Bin | Flag ________________________ 5.12 | 015 | ... | 0 | 0 5.78 | 0.28 | ... | 0 | 0 3.45 | 0.91 | ... | 1 | 0 3.94 | 0.85 | ... | 1 | 1 8.23 | 0.17 | ... | 2 | 0 ..... From the application_data set I can calculate the percentage of data within the respective bin, which I use to calculate "SAMPSIZE" for "PROC SURVEYSELECT" for the reference_data, e.g: Bin 1 = 5.12% Bin2 = 26.87% ... Using "SAMPSIZE", I now draw random samples from the reference_data which means that the stratified_reference_data composition will match the composition of application_data. This gives me a perfectly stratified reference_data. However, I need to make sure that all rows in which "Flag = 1" are included in the stratified reference_data set (in this regard random sampling has to be overridden), except when it would cause the stratified reference_data to have a different composition than application_data. (This would cause a bad Population Stability Index). I hope that I explained the problem understandably, otherwise let me know and I will try to clarify. Thanks in advance and best regards, Weiler
... View more