Hi all,
I'm using the blockrand package to create an allocation table for a randomized clinical trial and have been asked to set it up in a way I can't figure out. My code is below; it generates the 6:8 block sizes I need, and outputs without a problem. The challenge I have is that the Principal Investigator has now come back asking for "2 blocks to be randomly inserted", to have a pattern (for example) like 4/6/6/4/4/2/6/6/4/2/6. I don't know how to do this - I've spent a few hours playing around and reading various blogs etc. without luck.
Any help would be greatly appreciated. Thanks for your time,
Chris
mdd_int <- blockrand(n=20, block.sizes = 3:4, id.prefix = "MI", block.prefix = "MI", stratum = "MDD" )
mdd_con <- blockrand(n=20, block.sizes = 3:4, id.prefix = "MC", block.prefix = "MC", stratum = "MDD" )
gad_int <- blockrand(n=20, block.sizes = 3:4, id.prefix = "GI", block.prefix = "GI", stratum = "GAD" )
gad_con <- blockrand(n=20, block.sizes = 3:4, id.prefix = "GC", block.prefix = "GC", stratum = "GAD" )
my.study <- rbind(mdd_int, mdd_con, gad_int, gad_con)
write.csv(my.study, file="embc_random.csv")