Hi Listers,
I would like to create a randomisation list for a 2-arm study. I would like the randomisation to use permuted blocks of varying size (8, 10 and 12). The code is for fixed block size of 8 so I was hoping someone could share how to modify it to have varying block sizes...
clear
set obs 160
egen arm = seq(), to(2)
egen block = seq(), block(8)
set seed 314159
gen random = uniform()
bysort block (random): gen byte seqn = _n
bysort block (seqn): l seqn arm
I am aware of the -ralloc- command but I would like to modify code I found online to be able to understand what is done. I also find it surprising when using ralloc that even if I specify the number of participants to be allocated to be 340, it creates a list of 346 - can this be fixed?
ralloc blknum blksiz Rx, ns(340) ntr(2) init(8) osiz(3) sav(mylist) idvar(ID) tab seed(314159)
I would like to create a randomisation list for a 2-arm study. I would like the randomisation to use permuted blocks of varying size (8, 10 and 12). The code is for fixed block size of 8 so I was hoping someone could share how to modify it to have varying block sizes...
clear
set obs 160
egen arm = seq(), to(2)
egen block = seq(), block(8)
set seed 314159
gen random = uniform()
bysort block (random): gen byte seqn = _n
bysort block (seqn): l seqn arm
I am aware of the -ralloc- command but I would like to modify code I found online to be able to understand what is done. I also find it surprising when using ralloc that even if I specify the number of participants to be allocated to be 340, it creates a list of 346 - can this be fixed?
ralloc blknum blksiz Rx, ns(340) ntr(2) init(8) osiz(3) sav(mylist) idvar(ID) tab seed(314159)
Comment