Block Randomization : A Special Scenario

Block Randomization : A Special Scenario

Simple randomization is a process of random assignment of subjects based on a single sequence to groups. Block randomization works by randomizing participants within blocks such that an equal number is assigned to each treatment.

If suppose, we have a sample size of 24, simple randomization aims at ensuring equal allocation of subjects to treatment groups, such that at the end of randomization we have 12 assigned to one group and the other twelve to another. At any particular time during the process of randomization equal allocation cannot be ensured. This can, however, be handled by adopting block randomization, where random allocation is done within sub-groups of the sample size. So, if we have 24 subjects, we can divide them into 6 blocks of 4 subjects each, and then go ahead with equal allocation within each block. In this example, the randomization sequence can be chosen from the 6 possible assignment sequences.

Note that repeat blocks may occur when the total sample size is greater than the block size times the number of possible sequences. Furthermore, the block size must be divisible by the number of study groups.

A disadvantage of block randomization is that the allocation of participants may be predictable. In the above case, there are 6 possible allocation sequences and 6 blocks so a bias can occur in the case of open label studies.

Selection bias may be reduced by using random block sizes and keeping the investigator blinded to the size of each block.

Kreara has developed a SAS macro to generate a randomization list for this scenario. The main features of this macro are

  • Generation of a master database of all possible block sizes combinations corresponding to sample size and number of blocks.
  • Selecting only even block sizes and unique combinations.
  • Maintaining minimum and maximum block sizes.
  • Providing a seed of ones choice to ensure no repeat of randomization list is generated at subsequent execution of the macro.
  • Generating the randomization list for two treatment groups for any particular combination of block sizes and sample size.

/*Macro for ‘Block Randomization with Randomly Selected Block Sizes’*/

options nomlogic nomprint nosymbolgen;
%macro datagen(blkdim= ,obscnt= , seed= ,minval= , maxval= , splsize= ,odrsz= );

/*Create a data set having the observation of different selected block size and their sum results the required sample size*/

data simdata( drop=i j);
array blkno(&blkdim) ;
j=1;
do while (j le &obscnt);
splsize=0;
do i=1 to &blkdim;
blkno(i)=round(ranuni(&seed)*10,1);

/*Screen out the even number of block size for equal distribution of treatment groups*/

if mod(blkno(i),2)=0 then blkno(i)=blkno(i);
else blkno(i)=blkno(i)+1;
splsize=splsize+blkno(i);
end;
j=j+1;
output;
end;
run;

/*Delete the duplicate combination of the block length*/

proc sort data=simdata out=simdataout nodupkey;
by blkno1 – blkno&blkdim.;
run;

/*Permit the block size within the specified values*/

data simdata1;
array blkno(*) blkno1 – blkno&blkdim.;
set simdataout;
if min(of blkno(*))ge &minval and max(of blkno(*)) le &maxval and splsize=&splsize;
run;

data simdata1;
set simdata1;
order=_n_;
run;

/*Placing the List of block Values into a Series of Macro Variables represents the Block Size*/

proc transpose data=Simdata1(keep=blkno1 -blkno&blkdim order where=(order=&odrsz)) out=simdat_trn(keep=col1 rename=(col1=blk_sz));
by order;
run;

proc sql noprint;
select blk_sz into :blkno1 -:blkno&blkdim
from simdat_trn;
quit;

/*Random allocation of treatments with respect to block sizes using ‘Proc Plan’*/
/*Note: The allocation of treatment changes in each run since no seed value generated.
It will avoid the repetition of randomization of blocks having equal size*/

%do I =1 %to &blkdim.;
proc plan;
factors block=1 cell=&&blkno&I random /noprint;
treatments t=&&blkno&I random;
output out=rnddat&I(drop=block);
run;
data rnddat&I;
length TRT $50;
set rnddat&I;
if t>(&&blkno&I/2) then TRT=’A';
else TRT=’B';
block=&I;
%end;
run;
%mend;

/*Combine all the randomized blocks together for a site */

%datagen(blkdim=4,obscnt=100000,seed=100, minval=4, maxval=10, splsize=24 ,odrsz=1 );

Post A Comment

Protected by WP Anti Spam