Chapter 3 Randomize Using Excel



Download 470.5 Kb.
Page1/3
Date13.12.2016
Size470.5 Kb.
  1   2   3

Chapter 3-7. Randomize Using Excel

In the last chapter, we practiced taking a random sample.


In this chapter, we practice randomizing subjects into two treatment arms. This is easier to set up in Excel than in Stata.
Simon (1999) presents a simple approach to randomizing subjects to two or more experimental groups, which is the approach we will use.

To give a quick overview of what we are going with this topic, here is a suggestion for describing it to a colleague.


Suggestion for Advising Someone on Randomization
You should use a method called “random permuted blocks”. If you have two groups to assign subjects to, for example, you want the first two subjects to go into group A or group B in a random order. For the next two subjects, this is repeated, by the random order is selected independently of the previous two subjects. This is called a block of size 2. It might look something like: AB, BA, BA, AB, …where each block of size 2 will contain a possible permutation of the group assignments in a random order (thus, “random permuted blocks”). In this way, you achieve balance between the groups as the study progresses, with equal numbers in each group, which insures the groups remain balanced on any possible “learning effect”, such as the study team gets better at the study procedure as the study progresses. This also insures that the sample sizes are equal if the study has to be stopped early.

A randomization schedule is created. One column contains the numbers 1 to N, which is the order that the subjects are enrolled. This number is placed on the outside of an envelope. Inside the envelope is the group assignment. When the subject is enrolled, the envelope is opened to discover the group assignment.

An improvement over this is called “random permuted blocks with random block size”. In the approach described above, the study coordinator would be able to guess the group assignment of subjects 2, 4, etc., since the subject would be assigned to the opposite group of the previous subject, subject 1, 3, etc. To avoid this, a block size of 2, 4, and perhaps 6, is used, with the order of the block size randomized. This makes it impossible to guess the next subject’s assignment, because the coordinator will never know what block size is currently being used.

_____________________


Source: Stoddard GJ. Biostatistics and Epidemiology Using Stata: A Course Manual [unpublished manuscript] University of Utah

School of Medicine, 2011. http://www.ccts.utah.edu/biostats/?pageId=5385



Suggested Citation
The random permuted blocks approach, with or without random block sizes, is a well-establish procedure, so there is no need to give a citation for it, particularly in a research paper. However, if you are nervous that a grant reviewer will be unfamiliar with it, a good citation for both approaches is:
Friedman LM, Furberg CD, DeMets DL. Fundamentals of Clinical Trials, 3rd ed.,

New York, Springer, 1998, pp.64-66.


There is no need to cite the Simon (1999) paper, since that just a paper describing specifically how to do it in Excel, rather than an authoritative description and justification of these randomization methods.


Example: Here is an example of researchers using random permuted blocks for their randomization into study groups (Kuhn et al., N Engl J Med, 2008). In their Randomization subsection of their Methods section, they report,
“At 1 month post partum, participants who were still breast-feeding their infants (whose HIV status had not yet been determined) and were willing to continue with the study were randomly assigned to a study group with the use of a computer algorithm that was designed by the study statistician with a randomized permuted-block design within each site….”
Example: Here is an example of researchers using random permuted blocks with random block size for their randomization into study groups (Kirkley et al., N Engl J Med, 2008). In their

Study Treatment subsection of their Methods section, they report,


“The patients were randomly assigned, with the use of a computer-generated schedule, to receive optimized physical and medical therapy alone (control group) or to receive both optimized physical and medical therapy and arthroscopic treatment….To minimize the risk of predicting the treatment assignment of the next eligible patient, randomization was performed in permuted blocks of two or four with random variation of the blocking number.”
Simple Randomization
Suppose we want to randomize 10 subjects to 2 groups (intervention & control), with 5 in each group. The first step is to prepare a randomization list.
Enter the column headings Sequence and Group into cells A1 and B1, respectively. To enter the sequence number, enter “1” into cell A2, click on the lower right corner of the cell, hold down the Ctrl-key and drag downward for 10 rows. This will fill up the first column with the numbers 1 to 10. Enter “intervention” into cell B2, click on the cell, and drag down 5 rows (when you do not hold down the Ctrl-key, it simply duplicates the cell contents.) Enter “control” into cell B7, click on the cell, and drag down 5 rows. The spreadsheet should now look like this:





A

B

1

Sequence

Group

2

1

intervention

3

2

intervention

4

3

intervention

5

4

intervention

6

5

intervention

7

6

control

8

7

control

9

8

control

10

9

control

11

10

control

This has all of the group assignments we need (5 in each group). It simply needs to be put into a random order. To do that, we add a column of random numbers (uniform random numbers, ranging between 0 and 1). Add the heading RandNum into cell C1. Enter =rand() into cell C2. When you hit the Enter key, a random number replaces what you typed. Click on the number in cell C2. Drag down to row 11, which will fill the column with random numbers.


Your spreadsheet will now look like the following (except your random numbers will be different):





A

B

C

1

Sequence

Group

RandNum

2

1

intervention

0.131791

3

2

intervention

0.535269

4

3

intervention

0.08444

5

4

intervention

0.495398

6

5

intervention

0.514196

7

6

control

0.132303

8

7

control

0.558167

9

8

control

0.968525

10

9

control

0.098076

11

10

control

0.41867

The problem with what we have so far, is that these random numbers will automatically change each time the spreadsheet is updated (saving the file and opening it again, for example, will change all the random numbers). To fix the numbers so they are just values that cannot change, rather than calls to the function rand(), highlight the entire column of numbers, from cell C2 to C11. Click on Edit - Copy, then Click on Edit - Paste Special, select Paste - Values, and click OK. This makes the numbers permanent.


The best thing to do next is to copy all of these cells and paste them a few columns to the right, in the spreadsheet. That way, you have two tables to compare to make sure the randomization step (discussed next) worked correctly. It also gives you a way to recover easily if you make a mistake or simply want to start over.
Now we will randomize the group assignments. Highlight the the Group and RandNum columns of your second (duplicated) table. [It does not matter whether or not you include the entire column, or include the variable names (Group and RandNum), when you highlight the columns—Excel is clever enough to consider the first row as column headings, and so the first row does not get sorted along with the other cells.] Click on Data - Sort. Enter RandNum in the “Sort by” box, and then click OK.
Your table will now be sorted by the random numbers and the group column will be scrambled (Chaos created from Order).





A

B

C

1

Sequence

Group

RandNum

2

1

intervention

0.08444

3

2

control

0.098076

4

3

intervention

0.131791

5

4

control

0.132303

6

5

control

0.41867

7

6

intervention

0.495398

8

7

intervention

0.514196

9

8

intervention

0.535269

10

9

control

0.558167

11

10

control

0.968525



Random Permuted Blocks
The simple randomization approach will work for situations such as randomizing hospital units.
For the clinical trial situation, where subjects enter the study across time, a different approach is required. The problem with the simple randomization approach in this case is that an unequal sample size will accumulate in the two study arms as the study progresses, becoming balanced only at the end.
To assure balance as the data accumulate, which will help to avoid a “learning curve” bias, or any bias introduced by the time of entry into the study, a block randomization is used. We will use a block size of 2, so balance is achieved after every two subjects enter the study. [Any block size, that is a multiple of the number of groups, could be used.]
Beginning with the following columns (our randomization list from above before we sorted),





A

B

C

1

Sequence

Group

RandNum

2

1

intervention

0.131791

3

2

intervention

0.535269

4

3

intervention

0.08444

5

4

intervention

0.495398

6

5

intervention

0.514196

7

6

control

0.132303

8

7

control

0.558167

9

8

control

0.968525

10

9

control

0.098076

11

10

control

0.41867

, highlight and copy that into another location on your spreadsheet. Then, add the following Block column to the left of the RandNum column. [To insert a column, highlight the RandNum column, right click the mouse, and click on Insert.]







E

F

G

H

1

Sequence

Group

Block

RandNum

2

1

intervention

1

0.131791

3

2

intervention

2

0.535269

4

3

intervention

3

0.08444

5

4

intervention

4

0.495398

6

5

intervention

5

0.514196

7

6

control

1

0.132303

8

7

control

2

0.558167

9

8

control

3

0.968525

10

9

control

4

0.098076

11

10

control

5

0.41867

Next, highlight the columns F through H, using the mouse.







E

F

G

H

1

Sequence

Group

Block

RandNum

2

1

intervention

1

0.131791

3

2

intervention

2

0.535269

4

3

intervention

3

0.08444

5

4

intervention

4

0.495398

6

5

intervention

5

0.514196

7

6

control

1

0.132303

8

7

control

2

0.558167

9

8

control

3

0.968525

10

9

control

4

0.098076

11

10

control

5

0.41867

Click on the Data icon on the toolbar. Select “Sort”, then

Sort by: Block

Then by: RandNum



OK
which produces,





A

B

C

D

1

Sequence

Group

Block

RandNum

2

1

intervention

1

0.131791

3

2

control

1

0.132303

4

3

intervention

2

0.535269

5

4

control

2

0.558167

6

5

intervention

3

0.08444

7

6

control

3

0.968525

8

7

control

4

0.098076

9

8

intervention

4

0.495398

10

9

control

5

0.41867

11

10

intervention

5

0.514196

Notice that an intervention and a control are used every two rows of the randomization list, creating sample size balance every two study subjects.


This is called “random permuted blocks” because the permutations “AB” and “BA”, or “Intervention-Control” and “Control-Intervention”, are randomized, rather than just A and B.



Share with your friends:
  1   2   3


The database is protected by copyright ©dentisty.org 2019
send message

    Main page