Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Randomization using RALLOC with stratification

    Hi,

    I am trying to generate a random sequence with 4 treatment groups into 2 strata and using either block sizes of 4 or 8. I set my observations at 400 to get 100 in each treatment group. I use the following code below. I am having a problem afterwards where the strata option is not being randomized. it shows all 1s then all 2s below. How do I get both the treatment groups and the gender randomized within the block sizes? Thank you.


    ralloc blknum blzsize treat, nsubj(400) osize(2) equal ntreat(4) saving(mytrial) shape(long) seed(date) trtlab(0 1 2 3) strata(2) multif

    set seed 314159
    gen random = uniform()

    sort blknum StratID random

  • #2
    I did not understand your question. It seems you want participants to be randomized by sex.

    Your code is generating a random sequence for a trial with 800+ participants:

    List1: Male: 100+ participants per treatment group (100,100,100,100)
    List 2: Female: 100+ participants per treatment group (100, 100,100,100)

    I have put a plus sign because the total number of participants should be slightly larger than 800, since the number of blocks is random, and block sizes should always be 4 or 8.

    So, essentially, you have two lists. If the participant is male, he will be randomized according to list 1 (StratID==1). Otherwise, she will be randomized according to list 2 (StratID==2).
    Do not change the order of the randomization list.

    Comment


    • #3
      Tiago, Thank you. this was very helpful!

      Comment

      Working...
      X