Say we have a clinical trial whereby 36 subjects are to be randomized to either active
treatment or placebo in a 1:1 fashion.
All randomization will be stratified by site and for simplicity let us assume 12 subjects
will be randomized at each site.
proc format;
value trtFmt 0='Active drug' 1='Placebo';
value siteFmt 1='Buffalo General' 2='Millard Filmore'
3='ECMC';
run;
data data1;
seed = 49191;
phi = 0.5;
do site = 1 to 3;
do subj = 1 to 12;
subjid = site*100 + subj;
trt = ranbin(seed, 1, phi);
output;
end;
end;
format trt trtFmt. site siteFmt.;
run;
proc print data=data1 split='*';
pageby site;
by site;
id subjid;
var trt;
label subjid='Subject*Number*-------'
trt='Treatment*Assignment*----------';
run;
proc freq data=data1;
tables site*trt / nopercent nocol norow;
run;