[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Generating block randomation schedule using Stata
> I want to generate a randomization schedule for a study with 2 arms
> for a sample size of 800 with a block size of 8, or 100 blocks of 8.
> Is there a way to do this in Stata?
If I understand this correctly, you want to set up
a repeated list of identifiers and then shuffle it.
This illustrates some technique:
. set obs 800
. egen id = seq(), to(8)
. egen block = seq(), block(8)
. * or choose a different pie
. set seed 314159
. gen random = uniform()
. sort block random
. list block id
An alternative to -egen, seq()- is -egen, repeat()- on SSC.
That will repeat sequences other than contiguous integers.
* For searches and help try: