<p><strong>Disclaimer: I do not suggest using this solution for any real-world applications. This is simply a demonstration.</strong></p>

<hr>

<p>I'm not sure what your background is, but this is really easy to do in code. You could simply run a random number generator and print off the results for the clinician.</p>

<p>Here is an example solution in R:</p>

<pre><code>ngen &lt;- function(patients, weeks){
  df &lt;- data.frame( t( replicate(patients, sample(c("A","B"), weeks, replace=T)) ) )
  colnames(df) &lt;- paste(replicate(ncol(df), "Week"), as.character(1:ncol(df)))
  rownames(df) &lt;- paste(replicate(nrow(df), "Patient"), as.character(1:nrow(df)))
  print(df)
}
</code></pre>

<hr>

<p><em>Example Usage</em>:</p>

<p>ngen(patients = 10, weeks = 5)</p>

<pre><code>           Week 1 Week 2 Week 3 Week 4 Week 5
Patient 1       A      B      A      B      A
Patient 2       B      B      A      B      A
Patient 3       A      B      A      A      B
Patient 4       A      A      A      A      A
Patient 5       A      B      A      A      A
Patient 6       B      B      B      A      B
Patient 7       A      A      A      B      A
Patient 8       A      B      A      B      B
Patient 9       B      A      A      B      B
Patient 10      B      A      B      A      B
</code></pre>

<hr>

<p><strong>Check by simulating 10,000 weeks:</strong></p>

<pre><code>m &lt;- ngen(patients = 10, weeks = 10000)

# look at patient 1:
mean(as.numeric(m[1,]) - 1)
</code></pre>

<p>The mean condition for patient 1 is 0.5, 
i.e., even chance of being in condition A or condition B as n weeks goes to infinity.</p>

CC BY-SA 3.0
2016-03-17T19:30:21.820Z
I was hoping for something simpler. I do not want the clinician to have to refer to a chart.
StrongBad
CC BY-SA 3.0
2016-03-17T19:33:08.787Z
do they have a smart phone?
lnNoam
CC BY-SA 3.0
2016-03-17T19:39:43.660Z
Generally, it is considered poor practice for a clinician to look at their phone while treating a patient. Hence my requirement for no "equipment".
StrongBad
CC BY-SA 3.0
2016-03-17T19:48:43.017Z
Personally, when I do research I try to remove all traces of human bias. Humans have terrible intuitions when it comes to randomness. However, there is a nice paper I found reviewing this exact problem: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3136079/. They seem OK with the idea of a coin flip, provided you have a sufficiently large N.
lnNoam
CC BY-SA 3.0
2016-03-17T19:18:19.983Z
2016-03-17T19:30:29.553Z
2016-03-17T19:30:29.553Z
lnNoam
<p>You could generate a random 0-1 sequence at the start of the study and allocate participants as they come in based on that sequence. </p>

<p>You can use this simple online tool to generate the sequence ( <a href="https://www.randomizer.org/" rel="nofollow">https://www.randomizer.org/</a> ), if you want to avoid doing some basic programming.</p>

<p>You'll need to have a system for allocating IDs to participants, so I imagine that just preparing the sequence of random allocation ahead of time should be okay.</p>

CC BY-SA 3.0
2016-03-18T01:50:58.057Z
2016-03-18T01:50:58.057Z
Jeromy Anglim
<p>I am working with a clinician and need her to randomly assign patients into one of two groups with the goal of having roughly equal numbers in both groups. The clinician does not have access to a random number generator and it would be inappropriate for her to flip a coin before the allocation. We initially decided upon using the second hand on a clock and splitting on the top/bottom half of the minute, but the exam room does not have a clock and she does not wear a watch.</p>

<p>We are thinking of splitting on the first letter of the first name which is on the patient's chart. We would then flip every couple of weeks whether the first half of the alphabet was in group A or group B. Is this a reasonable approach? Is there a better one? If we go this way, what letter do we split on to give roughly equal sizes?</p>

<statistics><experiment-design>
How to random assign subjects to a group without any equipment?
StrongBad
# How to random assign subjects to a group without any equipment?

(Asked by: username_0 on 2016-03-17)

I am working with a clinician and need her to randomly assign patients into one of two groups with the goal of having roughly equal numbers in both groups. The clinician does not have access to a random number generator and it would be inappropriate for her to flip a coin before the allocation. We initially decided upon using the second hand on a clock and splitting on the top/bottom half of the minute, but the exam room does not have a clock and she does not wear a watch.

We are thinking of splitting on the first letter of the first name which is on the patient's chart. We would then flip every couple of weeks whether the first half of the alphabet was in group A or group B. Is this a reasonable approach? Is there a better one? If we go this way, what letter do we split on to give roughly equal sizes?

**Tags:** statistics, experiment-design


---

## 2 answers

### Answer by username_1 on 2016-03-17. Score: 1

Disclaimer: I do not suggest using this solution for any real-world applications. This is simply a demonstration.

I'm not sure what your background is, but this is really easy to do in code. You could simply run a random number generator and print off the results for the clinician.
Here is an example solution in R:
ngen <- function(patients, weeks){
  df <- data.frame( t( replicate(patients, sample(c("A","B"), weeks, replace=T)) ) )
  colnames(df) <- paste(replicate(ncol(df), "Week"), as.character(1:ncol(df)))
  rownames(df) <- paste(replicate(nrow(df), "Patient"), as.character(1:nrow(df)))
  print(df)
}


Example Usage:
ngen(patients = 10, weeks = 5)
           Week 1 Week 2 Week 3 Week 4 Week 5
Patient 1       A      B      A      B      A
Patient 2       B      B      A      B      A
Patient 3       A      B      A      A      B
Patient 4       A      A      A      A      A
Patient 5       A      B      A      A      A
Patient 6       B      B      B      A      B
Patient 7       A      A      A      B      A
Patient 8       A      B      A      B      B
Patient 9       B      A      A      B      B
Patient 10      B      A      B      A      B


Check by simulating 10,000 weeks:
m <- ngen(patients = 10, weeks = 10000)

# look at patient 1:
mean(as.numeric(m[1,]) - 1)

The mean condition for patient 1 is 0.5, 
i.e., even chance of being in condition A or condition B as n weeks goes to infinity.

> **Comments:**
> **username_0**: I was hoping for something simpler. I do not want the clinician to have to refer to a chart.  
> **username_1**: do they have a smart phone?  
> **username_0**: Generally, it is considered poor practice for a clinician to look at their phone while treating a patient. Hence my requirement for no "equipment".  
> **username_1**: Personally, when I do research I try to remove all traces of human bias. Humans have terrible intuitions when it comes to randomness. However, there is a nice paper I found reviewing this exact problem: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3136079/. They seem OK with the idea of a coin flip, provided you have a sufficiently large N.  

---

### Answer by username_2 on 2016-03-18. Score: 1

You could generate a random 0-1 sequence at the start of the study and allocate participants as they come in based on that sequence.

You can use this simple online tool to generate the sequence ( <https://www.randomizer.org/> ), if you want to avoid doing some basic programming.

You'll need to have a system for allocating IDs to participants, so I imagine that just preparing the sequence of random allocation ahead of time should be okay.


---

