Not exactly sure what do you want, but the surveyselect with strata certainly does help IMO. Here is an example.
data t1;
do i = 1 to 1000;
x=rannor(123)*3+5; type=1;
output;
end;
do i = 1 to 500;
x=rannor(123)*6+10; type=2;
output;
end;
drop i;
run;
proc surveyselect data=t1
SAMPSIZE=50
seed=4870192 out=Sample;
strata Type ;
run;
proc means data=sample nway VARDEF=WGT;
class type;
var x;
weight samplingweight;
run;
proc surveyselect data=t1
SAMPSIZE=(200 100)
seed=4870192 out=Sample;
strata Type ;
run;
proc means data=sample nway VARDEF=WGT;
class type;
var x;
weight samplingweight;
run;
|