Random Assignment

Topic
Research methods
Contents

Random assignment is the practice of placing participants in the groups of an experiment, such as treatment and control, purely by chance, so that each person has the same probability of ending up in any group. Because chance decides, the groups are expected to be similar in age, attitudes, motivation and everything else, measured or not. Any later difference in outcomes can then be attributed to the intervention, which is why random assignment is the foundation of internal validity in experiments.

Random assignment vs random sampling

The two are often confused, but they answer different questions.

Random samplingRandom assignment
What is randomWho gets into the studyWhich group each participant joins
What it protectsExternal validity: can results be generalized to the population?Internal validity: did the intervention cause the difference?
Used inSurveys, polls, probability samplingExperiments, A/B tests, clinical trials

A study can have one without the other. An experiment with student volunteers can use random assignment, so it shows a causal effect, but the volunteers were not sampled randomly, so the effect may not hold for other people.

Why random assignment works

  • It removes selection by the researcher. No one can, even unconsciously, put more motivated people in the treatment group.
  • It balances confounders on average, including ones you did not think of or could not measure.
  • It justifies the statistics. Significance tests and confidence intervals for the difference between groups assume that chance allocated the participants.

Balance is expected on average, not guaranteed in every study. With small groups, chance alone can produce noticeable differences, which is why the methods below exist.

Methods of random assignment

  • Simple randomization: each participant is assigned by a random number generator or coin flip. Easy, but group sizes can end up unequal in small studies.
  • Block randomization: participants are assigned in small blocks (for example, of 4) with equal numbers per group in each block, so group sizes stay balanced throughout.
  • Stratified randomization: participants are first split by a key variable, such as age band or site, and randomized within each stratum. This guarantees balance on that variable.
  • Cluster randomization: whole units (schools, stores, teams) are assigned, used when individuals in one unit cannot be kept apart.

Worked example

A company tests whether a new onboarding email raises activation. It has 200 new sign-ups this week.

  1. Generate a random number between 0 and 1 for each sign-up in a spreadsheet, sort by it, and assign the first 100 to the new email and the rest to the current one.
  2. Check balance descriptively: plan type, country and signup source should look similar in both groups. Many methodologists, including the CONSORT guidelines for clinical trials, advise against running significance tests on baseline differences, since any difference after proper randomization is by definition due to chance.
  3. After two weeks, 38 of 100 in the new-email group have activated against 29 of 100 in the control group. Test the 9-point difference with a significance test before drawing a conclusion. The A/B test significance calculator does this.

To plan group sizes, decide the smallest effect worth detecting and calculate the required sample first. The A/B sample splitter then divides the total into groups, evenly or by weights.

Random assignment in surveys

Survey researchers use random assignment in split-ballot experiments: respondents are randomly shown one of two versions of a question, a concept or a price, and the answers are compared. It is the standard way to test whether wording changes results and to run monadic and sequential monadic concept tests. In SurveyNinja, the A/B test of a question splits respondents between two wordings of a question, 50/50 by default, on all plans including Free.

Common mistakes

  • Assigning by convenience, such as by day of the week, alphabet or who signed up first. These patterns can be related to the outcome.
  • Letting the person enrolling participants know the next assignment. Keep the allocation concealed until the participant is enrolled.
  • Dropping participants after assignment without accounting for it. Analyze people in the group they were assigned to.
  • Re-randomizing until the groups "look right", which undermines the logic of chance allocation. Use stratification instead.
  • Confusing it with random sampling and claiming that a randomized experiment on volunteers represents the whole population.
2