Announcement

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

  • #16
    Thank you can any one guide me to update above code to generate
    ABAABBBA ABABABAA ABABBABABA BABBABAAABAA

    Means i want a random allocation of study Arms in Blocks keeping balance enrollment after each Block

    Thanks Everyone

    Comment


    • #17
      This is Really helpful. But i need a bit more help in this i would like to have randomly allocated Arms in 2 Arm study for e.g
      ABABABBAAB ABAAABBB AABABBAB

      Something like the above example would be best if i have balance arm allocation after 2 consecutive blocks

      Comment


      • #18
        I am not entirely clear what you want. First, if you use a correctly specified random permuted block allocation then you are guaranteed balance in treatments at the conclusion of each and every completed block. Second, if I take the pattern you show in post 16 above, that is, two treatments in blocks of size 8, 10 and 12, then you can achieve this using ralloc (available on SSC) using the following:

        Code:
        ralloc b s t, sav(myfile) init(8) osiz(3) nsubj(200)
        list, sepby(b)
        where just for demonstration purposes I have chosen a sample size of 200.

        Comment


        • #19
          Thank You Philip Ryan . I only need random effect in blocks too. Means when list by block each has different pattern of in terms of Arm

          Comment


          • #20
            Means when list by block each has different pattern of in terms of Arm
            This may or may not be possible. Consider a block of size 8. It is constrained to have 4 A's and 4B's. If we pick a subset of 4 from a subset of 8 for the A's, that completely determines that block as the B's are necessarily all in the complementary subset of 4. So the number of possible different patterns in a block of size 8 is 8C4 = 70. If your study uses more than 70 blocks of size 8, then it is inevitable that at least two of them will have the same pattern. Similar calculations can be done for other block sizes as well: for block size 10, there are 252 possible patterns, and for block size 12 there are 924. Of course, you can run a pretty large study before you run up against these limits. Even 8*70 is 560 participants, and the others are larger still. Of course even if you use fewer than 70 blocks of size 8, randomly generated, there is no guarantee that they will all have different patterns, only that it is possible.

            In any case, there is no reason why you would need every block to have a different pattern, even if it were possible. As long as the patterns are randomly generated, even if some patterns appear more than once, the purpose of block randomization is still served.

            Added: In fact, if you did constrain your randomization sequence so that no pattern in any block of 8 could be repeated, the randomization would be ruined. That's because for the last several blocks, you could simply tick off which of the possible patterns had already occurred, and you could be assured that the remaining blocks would come from the small number still unused. That would give you much increased probability of being able to correctly predict the randomization assignment of the next participant--which means that the randomization has been defeated.
            Last edited by Clyde Schechter; 19 Sep 2022, 19:55.

            Comment


            • #21
              Thank you so much Clyde Schechter

              Comment

              Working...
              X