Announcement

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

  • ralloc function in stata

    Hello everyone,

    This might be a basic question but I would appreciate your help. I want to create randomisation list using the following chunk of a code "ralloc block size treat, nsubj(14) ntreat(2) ratio(1) osize(2) init(4) strata(16) seed(110) sav(rand_list) idvar(ID)". It is working well, but I do not want block sizes of 4 and 6, rather I want block sizes 4 and 10. How can i adapt this code to return block sizes of 4 and 10?

    Looking forward to your responses. Thank you!

  • #2
    I'm not sure if this can be done in any of the user-written commands (others include, e.g., randomize, randtreat, ccrand) and recommend that you trying writing to the author - he is retired but has previously been willing to help; there is a pre-retirement email address at the bottom of the help file

    added: forgot to note that it has been several years since I have been in contact with him; further, he is (was?) located in Australia so the time difference may be an issue
    Last edited by Rich Goldstein; 07 May 2025, 11:42.

    Comment


    • #3
      [Thanks Rich]

      I am retired, and I do live in Australia, and I do try to keep supporting my programs (to the extent my rapidly waning skills at programming allow).

      -ralloc- was not designed to allow fine grained choice of block sizes, and rewriting the program to allow this is not on my agenda. I can think of one relatively simple approach (kludge) that may help:

      Code:
      ralloc block size treat, nsubj(14) ntreat(2) ratio(1) osize(4) init(4) strata(16) seed(110) sav(rand_list) idvar(ID)
      note that we now specify osize(4) rather than osize(2). This will give blocks of size 4, 6, 8 and 10. After running the command, simply drop any observations for which size is 6 or 8, since they are not required.

      This procedure should not affect the integrity of the randomisation sequence you have generated.

      Check the results carefully (!) as I have not tested this approach to any great extent.

      Comment

      Working...
      X