help rct_minim-------------------------------------------------------------------------------

Title

rct_minim-Allocation of treatments to balance prognostic factors incontrolled trials

Syntax

rct_minim,filestub(filenamestub)nt(#)nf(#)nl(#1 [#2[...])pchoice(a|b|c)[options]

optionsDescription ------------------------------------------------------------------------- Mainfilestub(filenamestub)filename prefix for allocations and factor balance files; required optionnt(#)number of treatment groups; required optionnf(#)number of prognostic factors; required optionnl(#1 #2...)number of levels infactor1 factor2etc; required optionpchoice(a|b|c)method to calculate treatment assignment probabilities; required optionOptions *

p(#)specify probability p forpchoicemethoda*q(#)specify parameter q forpchoicemethodb*t(#)specify parameter t forpchoicemethodctreatvar(varname)name of treatment group variablefactnames(name1 name2...)names of prognostic factorspattern(#1 #2...)current subject's levels on each prognostic factorw(#1 #2...)weights for each prognostic factormchoice(range|var|sd|thresh)method for measuring imbalance in prognostic factorslimit(#)limit of acceptable imbalance (specified whenmchoice(thresh)is specified)delay(#)specify first # subjects are allocated treatments at randomwarnuser response required between re-display of command and treatment assignmentshowdetaildisplay detailed output------------------------------------------------------------------------- * one of

p,qortmust be specified

Description

rct_minimassigns subjects to treatment groups so as to balance categorical or ordered categorical prognostic factors across the treatments using a process calledminimization(see Pocock and Simon (1975)). This is a form of "covariate adaptive randomisation", the assignment for the current subject dependsinter aliaon (i) all previous subjects' treatment assignments, (ii) all previous subjects' patterns of prognostic factors, and (iii) the current subject's pattern of prognostic factors.Treatment assignment by minimization may be useful in smaller trials, when the number of strata is large relative to the sample size, and/or when balance of prognostic factors is judged to be critically important. [See

rallocfor a more common method of randomisation using randomly permuted blocks and stratification.]

Options+------+ ----+ Main +-------------------------------------------------------------

filestub(filenamestub)specifies the prefix of the names of 2 files thatrct_minimwill create on its first invocation and use on each subsequent treatment assignment.The

firstfile will be namedfilenamestub_rand.dta; for each subject it stores the treatment assignment, the factor levels, a system-generated_SeqNumvariable giving the sequential number of that subject's allocation, and a system-generated binary variable,_minim, indicating whether (1=yes) or not (0=no) the minimising algorithm was invoked for that subject (see optiondelaybelow).The

secondfile will be namedfilenamestub_factbal.dta; it stores summary count data on the distribution of treatment assignments and prognostic factor levels in a layout similar to Table 1 of Pocock and Simon. Data from this file are used withinrct_minimto construct afactor balance matrix.

nt(#)specifies the number of treatment groups;#must be at least 2.

nf(#)specifies the number of prognostic factors;#must be at least 1.

nl(#1 #2...)specifies the number of levels offactor1 factor2etc;#must be at least 2 for each factor. Separate the#s by one or more spaces.

pchoice(a|b|c)specifies how to calculate probabilities that will determine the extent of the bias in treatment assignments. Minimization seeks to assign a treatment based on minimising the prognostic factor imbalance. This imbalance is reflected in function Dithat measures the extent of variation across treatments for levels of factori. By default,rct_minimspecifies Dias therangein the counts of each level of factoriacross treatments (see optionmchoicebelow for alternative methods of measuring imbalance in factors), and then calculates Gk, a sum (perhaps weighted) of the Difor each treatmentk(k = 1..nt). We may thendeterministicallyassign the subject to the treatment that will minimise G, or, perhaps in an effort to better protect the blinding, assign the subject to treatments in a random fashion following an empirical probability distribution. This distribution will of course assign more probability to the treatment minimizing G. Pocock and Simon discuss 3 methods, denoted "a", "b" and "c" for setting up the probability distribution (see section 3.3 of their paper).Method

aspecifiespas the probability for the assignment to the treatment with the lowest value of G, andpk= (1-p)/(nt-1) for every other treatment (k = 2...nt) where k is ordered for increasing values of Gk. Ifp= 1 then the assignment is automatically to the treatment minimizing G. Ifp= 1/ntthen each treatment has equal probability of being assigned. Commonly,p= 2/3 is chosen as a compromise between maintaining the blinding and affording a bias in the assignments to achieve factor balance.Method

bspecifiesqas some constant such that the probability distribution takes account of the ranking of Gkfor all k (and not just for k = 1 as is the case in Methoda). pk=q- [2k((nt*q)-1)/(nt(nt+1))] (k = 1...nt). Pocock and Simon give an example usingq= 1/2 in a 4 treatment trial, yielding p1= 0.4, p2= 0.3, p3= 0.2 and p4= 0.1. That is, the subject will be assigned to the treatment for which G is minimized with probability 0.4, to the treatment for which G is next in ordered value with probability 0.3 and so on.Method

cspecifiestas some constant such that the probability distribution takes account of the actual value of Gkfor all k (and not just for the ranking of Gkas is the case in Methodb). The higher the value oftthe more bias in treatment assignment. Under this method pk= (1/(nt-t)) * [1 - (t*Gk/sum(Gk)] (k = 1...nt).The three methods and their associated probability distributions do not apply to the first subject's treatment assignment. This is determined by simple randomisation with assignment to each group equally likely.

+---------+ ----+ Options +----------------------------------------------------------

p(#)specifies value of p whenpchoice(a) has been chosen.#must lie between 1/ntand 1.

q(#)specifies value of q whenpchoice(b) has been chosen.#must lie between 1/ntand 2/(nt-1).

t(#)specifies value of t whenpchoice(c) has been chosen.#must lie between 0 and 1.

mchoice(string)specifies the method of measuring the imbalance in prognostic factors across treatments. The default isrange. Alternatives arevar(variance of the counts within a factor level across treatments),sd(standard deviation of the counts), andthreshwhich signals that a bias in treatment assignment will only proceed if the imbalance in the range of counts exceeds a specifiedlimit.

limit(#)specifies the maximum acceptable (integer) imbalance in prognostic factor levels before a bias in treatment assignment (designed to correct the imbalance) will be invoked. Used with optionmchoice(thresh). Default is 1.

treatvar(varname)} specifies the name of the treatment group variable; default is "_group".

factnames(name1 name2...)specifies the names of the prognostic factors; default is "factor1", "factor2" etc

pattern(#1 #2...)specifies this subject's levels on each prognostic factor. Ifpatternis not specified the user is prompted to enter the levels one factor at a time at the cursor. This is simply a convenience feature, as the factor levels may be the only option to change for each subject.

w(#1 #2...)specifies the relative importance weights for each prognostic factor. These are used in the linear combination of the Dito form the Gk. Higher relative weights are given to factors for which an imbalance would be most unwelcome. The#ishould each exceed 0.

delay(#)specifies that the first#subjects are allocated treatments purely at random (with equal probabilities) - the minimisation algorithm is not used for these subjects. [Note that the first subject is always allocated his/her treatment at random, since no factor balance matrix yet exists.] The default isdelay(1), implying that the minimisation algorithm will be used for the second and subsequent subjects.

warnspecifies that a user confirmation will be required between re-display of the command and the actual treatment assignment; by default no warning is given. Because sequential invocations ofrct_minimmay occur after some time has elapsed, it is important for the integrity of the study design that certain options are specified consistently, especiallyfilestub,nt,nfandnl. On each invocationrct_minimsaves twocharacteristicsto the data files. The first, named_dta[TD_n](where n is the sequential number of the current subject), stores the time and date of the assignment. (See alsoNotebelow). The second characteristic, named_dta[minim_n]stores the command and options that were issued. Specifyingwarncausesrct_minimto re-display the current command and also the contents of_dta[TD_n-1]and of_dta[alloc_n-1](that is, the command as issued for the previous assignment) so that the user can compare these and decide whether or not to proceed with the current randomisation. This is in addition to other error traps within the program.

Note: The characteristic_dta[TD_n]stores the time and date of the assignment.rct_minimuses the date and time, in that order, concatenated and stripped of any non-numeric characters to form the seed for the current assignment. (This seed is also displayed when optionshowdetailis specified.)

showdetailspecifies that detailed output is displayed. The default is minimal output, but it would be prudent to both open a log file and specifyshowdetailfor each treatment assignment.showdetailwill cause the following to be displayed:the seed (set from the date and time) the method chosen for measuring imbalance in prognostic factors the weight vector the status of the progostic factor balance matrix from the previous assignment the sequential number of the subject about to be assigned treatment the status of the progostic factor balance matrix for each possible treatment assignment for the current subject the values of weighted G for each treatment group the values of weighted G for each treatment group, sorted in ascending order (with ties broken at random) the smallest value of G and the treatment group it represents the random number

uused to determine the actual treatment allocation the cumulative probability distribution (set up by eitherp,qort); the value ofuwith respect to this distribution determines the assignment. the final treatment group assignment the updated prognostic factor balance matrix

ExamplesBasic setup for 2-arm trial with 3 prognostic factors; the

firstsubject is at level 1 for factor1, level 3 for factor2, and level 2 for factor3. Thesecondsubject is at level 2 for each factor. Use the defaultrangemethod to measure imbalance.

. rct_minim, filestub(my_trial) nt(2) nf(3) nl(2 4 3) pchoice(a)p(.66667) showdet warn pattern(1 3 2). rct_minim, filestub(my_trial) nt(2) nf(3) nl(2 4 3) pchoice(a)p(.66667) showdet warn pattern(2 2 2)3-arm trial with 2 user-named prognostic factors, sex has 2 levels, age_group has 5 levels; no warnings and no detail displayed; program will request current subject's levels on each factor

. rct_minim, filestub(your_trial) nt(3) nf(2) factnames(sex age_group)nl(2 5) pchoice(a) p(.75)Same design as previous example but this time, in an effort to better protect the blind, delay the minimization process until the 11th subject is randomized; the first 10 subjects will have their treatments allocated at random.

. rct_minim, filestub(her_trial) nt(3) nf(2) factnames(sex age_group)nl(2 5) pchoice(a) p(.75) delay(10)Mimic example from section 3.4 of Pocock and Simon. Ensure that files

pocock_simon_v3_rand.dtaandpocock_simon_v3_factbal.dta(available with therct_minimpackage from SSC) are installed in the current path. 50 subjects have already been randomised, whither the 51st?

. rct_minim, filestub(pocock_simon_v3) w(2 1 1) nt(3) nf(3) nl(2 2 3)pchoice(a) p(`=2/3') pattern(1 2 2) treatv(treatment) showd

ReferencePocock, S.J. and Simon, R. [1975]. Sequential treatment assignment with balancing for prognostic factors in the controlled clinical trial. Biometrics 31, 103-115.

AcknowledgementsThanks to Kit Baum, Boston College Economics and DIW Berlin, for suggesting some useful Mata code. Thanks also to Tom Sullivan, DMAC, University of Adelaide, for helping test and debug

rct_minim.

AuthorPhilip Ryan Data Management & Analysis Centre Discipline of Public Health Faculty of Health Sciences University of Adelaide South Australia philip.ryan@adelaide.edu.au

See alsoSTB:

rallocin STB-54 sxd1.2, STB-50 sxd1.1, STB-41 sxd1 SJ:rallocin SJ 8(4):594, SJ 8(1):146