Repeated measures and crossover designs: measuring the same people more than once

To see if a blood pressure drug works, we measure twelve people at weeks 0, 4, 8 and 12. People start at very different blood pressures, so a small drop in the average is easily hidden by those differences. Move things yourself to see what changes when you follow the same people, and what you have to watch out for in return.

Short answer. If you measure the same people more than once, you can take away how different people are to begin with and compare only the change inside each person. That is why an effect shows up with fewer people. A crossover design gives every person both treatments, one after the other. The catch: values from the same person are alike, so you must not analyze them as if they came from separate people, and you have to watch for the first treatment's effect spilling into the next period (the carryover effect).

All data on this page (blood pressure, people, drugs A and B) is made up with a fixed-seed random number generator. This page explains statistical ideas only. It is not advice about any drug or treatment.

Both pictures show the same values. The left one joins each person's values with a line. The right one removes the lines and keeps only the weekly mean (blue) and spread (purple, mean ± 1 standard deviation). The sliders also move with the arrow keys. "Draw 12 new people" changes the seed and makes up twelve different people.

Definitions

The page explains with twelve or five people, but the definitions are the same for n subjects and any number of time points (or conditions). yij is the value of subject i at time point j.

repeated measures design
A design that measures the same subjects at two or more time points or under two or more conditions. Measurements from the same subject are not independent of each other.
between-person variation, within-person variation, intraclass correlation
Split a value as below into the mean at that time point μj, the subject's offset bi (variance σb2) and the noise of each measurement εij (variance σw2). Then σb2 is the between-person variation and σw2 the within-person variation. If b and ε are independent, the correlation of two values from the same subject is the intraclass correlation (ICC).

yij=μj+bi+εij

ρ=Corr(yij,yik)=σb2σb2+σw2(j≠k)

paired t-test
Take each subject's difference di=afteri−beforei, then build the test statistic from the mean d¯ and sample standard deviation sd of the n differences. If the differences are independent and normal with mean 0, t follows the t distribution with n − 1 degrees of freedom.

t=d¯sd/n

sphericity
An assumption of repeated measures ANOVA with three or more time points: the variance of the difference is the same for every pair of time points.

Var(yij−yik) is the same for every j≠k

crossover design
A design where each subject gets all the treatments being compared, one after another, and the order is set at random for each subject. A 2×2 crossover design has treatments A and B, the orders A → B and B → A, and two periods, with a washout period between them. A difference that comes with the period for everyone, whatever the treatment, is the period effect.
carryover effect
The effect of the treatment from an earlier period lasting into the measurement of a later period. In a 2×2 crossover design where only the A-first group has carryover, the estimate that averages the two orders' mean (A − B) has the expected value below (τ is the true difference between A and B).

τ−carryover2

pseudoreplication and design effect
Pseudoreplication is analyzing measurements that are not independent (repeated values from the same subject) as if they were independent observations. With m measurements per subject, the design effect is how many times larger the true variance of the mean is than it would be if the same number of measurements were all independent.

design effect=1+(m−1)ρ

1. Between-person and within-person variation

Repeated measures means measuring the same person (or the same animal, the same dish of cells) two or more times. Measuring over time (weeks 0, 4, 8, 12) counts, and so does measuring the same person under different conditions (while taking drug A and while taking drug B).

Split the reasons values are spread out into two, and you can see why repeated measures help.

WhatIn plain wordsExampleSlider in the lab
Between-person variationHow much people's natural starting levels differOne person usually sits at 120, another at 160Between-person spread
Within-person variationHow much the same person wobbles each time you measureHow they feel that day, the device, their postureWithin-person noise

The lab makes up its data like this.

value=140+this person's offset+true change×week12+noise

Each person's offset is drawn once and used at all of that person's weeks (its standard deviation is the between-person spread). The noise is drawn fresh at every measurement (its standard deviation is the within-person noise). If you take week 12 − week 0 for each person, the offset drops out, because both of that person's values contain the same offset. Only the true change and the noise are left. That is why the lines in the left picture have similar slopes no matter how big the between-person spread is.

If you treat the same values as "different people each week", like the right picture, you have to compare the difference in weekly means against the width of the clouds, which is mostly between-person spread. When that spread is large, the change is buried.

How alike are two values from the same person? When the only thing that differs between people is their starting level, as in this lab:

correlation of two values from the same person=between-person variancebetween-person variance+within-person variance

With the starting values that is 12² ÷ (12² + 3²) = 144 ÷ 153 ≈ 0.94. The bigger the between-person spread and the smaller the noise, the more alike one person's values are. Textbooks call this ratio the intraclass correlation (ICC).

Try this. (1) At the start (between 12, within 3, change −8) the mean drops from 145.5 to 137.2, by 8.3, but within one week people are spread out by 12.3 on average (standard deviation). The clouds on the right mostly overlap. On the left all 12 people went down, and the change per person has mean −8.3 and standard deviation 3. (2) Raise the within-person noise to 10: only 8 people go down, and the standard deviation of the change per person becomes 10. Comparing inside each person does not remove the noise. (3) Put the noise back to 3 and raise the between-person spread to 20: the clouds on the right now spread by 20, but the shape of the lines on the left and the change's standard deviation of 3 stay the same. Lower the between-person spread to 0 and the change is clear on the right too (spread 2.6). (4) From the starting values, set the true change to 0: 7 of the 12 people still go down. With no effect at all, about half go down from noise alone.

A before-and-after comparison cannot tell you it was the drug

The lab above follows one group over time. Even if blood pressure went down, this data alone cannot say whether it was the drug, the season, the natural course of the illness, or people getting used to being measured. If you only pick people whose blood pressure is high, their next reading tends to come back toward the average a little even if nothing is done (regression to the mean). So to talk about an effect you compare with a control group that lived through the same weeks (randomization and control groups), or you mix up the order as a crossover design does (section 7). What repeated measures give you is a sharper comparison, by taking away between-person variation. Telling cause apart is the job of the design.

2. Same data, two analyses: independent t and paired t

Now cut the time points down to two (week 0 = before, week 12 = after). There are two ways to compare the before and after means (t-test).

The top of both fractions is the same, because after mean − before mean = mean of the differences. What differs is the bottom, the standard error. The independent analysis has the between-person variation in it. The paired analysis does not.

AnalysisMean differenceStandard errortDegrees of freedomp
Independent groups (Welch)
Paired

When the made-up data is created, the ρ slider splits the variance at one time point (100) into a between-person share (ρ) and a within-person share (1 − ρ). Changing ρ keeps the spread at one time point (standard deviation 10) and the true change (−5) the same. It only makes each person's before and after more or less alike. With the same seed, the same twelve people shift a little. The correlation r measured from the sample is a bit different from ρ. "Hand example (5 people)" switches to the numbers in section 4. The right picture estimates how many people you need to find a difference of 5 mmHg with standard deviation 10, a two-sided 5% test and 80% power.

Try this. (1) At the start (ρ = 0.8) the sample correlation is r = 0.83 and the mean difference is −5.41. The independent analysis has standard error 3.39, t = −1.6, p = 0.125, so it cannot tell the change apart from luck. The paired analysis has standard error 1.38, t = −3.91, p = 0.002. Same data. (2) Lower ρ to 0: r = −0.14, and the two analyses come out close (independent p = 0.053, paired p = 0.082). Pairing gives nothing here. This sample's r is slightly negative, so the paired standard error (3.1) is even larger than the independent one (2.9), and the paired test has 11 degrees of freedom against 21.9. (3) Raise ρ to 0.9: the paired standard error drops to 0.98 and p < 0.001. The independent analysis barely moves (standard error 3.27, p = 0.12). (4) On the right, a two-group design needs 63 per group, 126 people in all. The paired design needs 63 people at ρ = 0 (two measurements each, so the same 126 measurements), 32 at 0.5, 13 at 0.8 and 7 at 0.9.

The curve on the right uses these formulas (an approximation based on the normal distribution).

people for a paired design≈(1.96+0.84)2×2σ2(1−ρ)δ2

people per group for a two-group design≈(1.96+0.84)2×2σ2δ2

δ is the difference you want to find (5) and σ is the standard deviation at one time point (10). 1.96 is the cut-off for a two-sided 5% test and 0.84 is the point of the standard normal distribution that matches 80% power. The only difference between the two formulas is (1 − ρ), and that comes from the formula in the next section. With only ten or so people, the t distribution's cut-off is wider than 1.96, so you need a few more people than this estimate. The exact calculation is on the sample size page.

Wrong ways to read it. (1) The paired p = 0.002 does not mean "a 0.2% chance the drug does nothing". It means "the chance of a difference this big or bigger by luck alone, if there were no effect". (2) The independent p = 0.125 is not evidence of no effect. It means this analysis could not tell the change apart from luck. (3) Do not run both analyses and keep the smaller p. Which analysis to use is decided in advance by how the data was collected (are they the same people?). More on the hypothesis testing and p-values page.

3. How the formula is built: the variance of the differences

Why the paired analysis helps comes down to one formula.

Var(after−before)=σ12+σ22−2ρσ1σ2

Var is the variance, σ₁ and σ₂ are the standard deviations before and after, and ρ (rho) is the before-after correlation of the same people. We put the same data as the lab above (the ρ you chose, or the hand example) on a scatter plot and build the formula one step at a time.

Press "Next" to go one step at a time. A piece is added to the formula on top (the orange background marks the new piece), the picture changes by that step, and below you get the reason and this data's numbers. If you change the ρ slider or press "Hand example (5 people)" in section 2, this picture switches to the same data.

Written only as formulas, the steps above look like this. The last line uses the numbers of the hand example in section 4.

Var(after−before)=Var(after)+Var(before)−2Cov(before,after)

Cov(before,after)=ρσ1σ2⟹Var(after−before)=σ12+σ22−2ρσ1σ2

σ1=σ2=σ⟹σ2+σ2−2ρσ2=2σ2(1−ρ)

SE=σ12+σ22−2ρσ1σ2n

40+22.5−2×27=8.5

  1. Scatter plot: Var(after − before) = ? Each dot is one person. What we want to know is how spread out each person's difference (after − before) is. The smaller that spread, the more clearly the mean difference shows.
  2. No pairs (ρ = 0): σ₁² + σ₂². For two unrelated values, the wobbles do not cancel in the difference. They add up. Even for a subtraction, the variances add (the same idea as "add two independent values and their variances add" on the probability distributions page). In the picture we pair each after value with somebody else's before value (by rotating the list) so the correlation is close to 0. With the starting data the shuffled correlation is 0.01 and the variance of the differences is 137.2, close to the sum of the two variances, 73.4 + 64.6 = 137.9.
  3. High goes with high (ρ > 0): − ? Back to the real pairs, the dots form a long cloud along the diagonal. Whoever was high before is high after. The starting data has correlation 0.83. If the two values move together, that shared part has to be taken away.
  4. Take away the overlap: − 2ρσ₁σ₂. The difference after − before is how far the dot sits above or below the diagonal (after = before), measured straight up or down. The closer the dots hug the diagonal, the shorter the lines. The amount the two values move together (the covariance) is ρσ₁σ₂. The 2 is there because when you expand (after − before)² you get after² − 2 × after × before + before², so the cross term shows up twice. With the starting data, 73.4 + 64.6 − 114.9 = 23, and the variance measured directly from the differences is also 23.
  5. Equal σ: 2σ²(1 − ρ). Put σ₁ = σ₂ = σ and you get σ² + σ² − 2ρσ² = 2σ²(1 − ρ). That is the no-pairs value 2σ² times (1 − ρ). ρ = 0.8 gives one fifth, 0.5 gives half, 0 gives no change. If ρ is negative, the variance gets bigger.
  6. So the standard error shrinks and t grows: SE = √(σ₁² + σ₂² − 2ρσ₁σ₂) ÷ √n. The standard error of the mean difference is the standard deviation of the differences divided by √n. With equal σ it is √(1 − ρ) times the no-pairs value. The mean difference does not change, so t grows by one over that. With the starting data, real pairs give standard error 1.38 and t = −3.91; shuffled pairs give 3.38 and t = −1.6.

Try this. (1) With the starting data, go to step 4: 73.4 + 64.6 − 114.9 = 23 matches the variance of 23 measured directly in the strip. When you plug in the variances and correlation measured from the sample, the formula is not an approximation. It is exact. (2) Press "Hand example (5 people)" in section 2 and step through again: step 4 shows 40 + 22.5 − 54 = 8.5. (3) Lower the ρ slider to 0 and look at step 4: the orange lines get long, and the real and shuffled differences spread about the same.

4. Work it by hand: five people before and after

Blood pressure (mmHg) of five made-up people. These are the same numbers as "Hand example (5 people)" in section 2.

PersonBeforeAfterDifference d = after − befored − mean(d − mean)²
1148140−8−39
2136133−324
3152146−6−11
4140139−1416
5144137−7−24
Sum720695−25034
  1. Mean difference. d̄ = −25 ÷ 5 = −5. The same as after mean 139 − before mean 144.
  2. Variance and standard deviation of the differences. s_d² = 34 ÷ (5 − 1) = 8.5, s_d = √8.5 ≈ 2.92. We are estimating from a sample, so we divide by n − 1 (the sample variance on the probability distributions page).
  3. Standard error. SE = 2.92 ÷ √5 ≈ 1.30.
  4. t and degrees of freedom. t = −5 ÷ 1.30 ≈ −3.83, with 5 − 1 = 4 degrees of freedom.
  5. p-value. In a t distribution with 4 degrees of freedom, the chance that |t| is 3.83 or more (both sides) is about 0.019. It lies beyond 2.78, the two-sided 5% cut-off for 4 degrees of freedom.

The same calculation written as formulas looks like this.

d¯=−255=−5

sd2=345−1=8.5,sd=8.5≈2.92

SE=sdn=8.55=1.7≈1.30

t=d¯SE=−51.7≈−3.83,df=5−1=4

The same numbers as two independent groups. The before variance is (4² + 8² + 8² + 4² + 0²) ÷ 4 = 160 ÷ 4 = 40 and the after variance is (1² + 6² + 7² + 0² + 2²) ÷ 4 = 90 ÷ 4 = 22.5 (distances from the means 144 and 139). Standard error √(40 ÷ 5 + 22.5 ÷ 5) = √12.5 ≈ 3.54, t = −5 ÷ 3.54 ≈ −1.41, Welch degrees of freedom about 7.4, p ≈ 0.20. The same mean difference of −5, but a standard error about 2.7 times larger.

Check with the formula. The covariance is (4 × 1 + (−8) × (−6) + 8 × 7 + (−4) × 0 + 0 × (−2)) ÷ 4 = 108 ÷ 4 = 27 and the correlation is 27 ÷ (√40 × √22.5) = 27 ÷ 30 = 0.9. Var(after − before) = 40 + 22.5 − 2 × 27 = 8.5, the same 8.5 as in step 2.

# The same calculation in Python (scipy)
from scipy import stats
before = [148, 136, 152, 140, 144]
after = [140, 133, 146, 139, 137]
stats.ttest_rel(after, before)                    # paired: t ≈ −3.83, p ≈ 0.019
stats.ttest_ind(after, before, equal_var=False)   # independent (Welch): t ≈ −1.41, p ≈ 0.198

5. Key properties

PropertyIn plain wordsIn the labs
Between-person variation drops outThe difference is taken inside each person, so starting levels cancel. What is left is the true change and the within-person noiseSection 1 lab, between-person spread at 20
The gain depends on the correlationThe variance of the differences is 2σ²(1 − ρ). With ρ = 0 there is no gain and you only lose degrees of freedom. With a negative ρ it is worseThe ρ slider in section 2, step 5 in section 3
Values from the same person are not independentCounting similar values as separate makes the standard error too small and gives false "significant" results. The sample size is the number of people, not the number of measurementsSection 8 lab
Order gets mixed inA later measurement also carries the passing of time, practice, tiredness and the effect of the earlier treatmentPeriod effect and carryover in section 7
People drop outAsk people to come back many times and some stop coming. If the reason they leave is tied to the outcome, analyzing only those who stayed is biasedSection 9

6. What you gain and what it costs

What you gainWhat it costs
Between-person variation drops out, so you get the same precision with fewer peopleDropouts: the longer the study and the more visits, the more people leave
Each person is their own comparisonOrder effects: things that change by themselves over time (season, the course of the illness, regression to the mean) get mixed with the treatment
You can see a curve of how each person changes (who changes fast, who slowly)Practice effects: doing the same test again makes people better at it
Fewer people to recruit, so less time and moneyFatigue effects: measure many conditions in one sitting and people get tired toward the end
Carryover: an earlier treatment lingers into a later measurement (section 7). And because measurements are alike, the analysis gets more complicated (sections 8 and 9)

Order, practice and fatigue effects can be kept from piling up on one side by changing the order of conditions from person to person (a crossover design, balanced orders). Mixing the order only cancels effects that push everyone the same way. An effect that depends on the order, like carryover, stays (section 7).

7. Crossover design: everyone gets both treatments

In a crossover design each person gets both treatments one after the other (a new drug A and a comparison B, for example a placebo). The order is chosen at random for each person. Half get A first (A → B), half get B first (B → A). Between the two periods there is a washout period with no treatment, so the first treatment's effect can wear off. Two orders × two periods is called a 2×2 crossover, the most common form.

Each person has a value on A and a value on B, so the treatment effect can be compared inside each person, with all the benefits of repeated measures. Unlike the before-and-after comparison in section 1, mixing the order lets you separate "change from time passing" from "the treatment". The estimate is:

effect estimate=12×(mean of (A−B) in the A-first group+mean of (A−B) in the B-first group)

Twelve made-up people (6 A-first, 6 B-first). The true effect is "A lowers blood pressure by 6 compared with B". The period effect is how much everyone changes in period 2 (negative = lower). Carryover is the share of A's effect still there in period 2 with no washout; we made it halve with every week of washout. How fast a real drug wears off differs from drug to drug. "Without noise" means the estimate from the same people with the within-person noise set to 0, which is the expected value of the estimate.

Try this. (1) At the start (period effect −2, carryover 0) the A-first group's mean (A − B) is −2.9 and the B-first group's is −8.5. Look at one group alone and the period effect makes it too small in one group and too big in the other (−4 and −8 without noise). The average of the two is −5.7, and without noise it is −6, so the bias is 0. (2) Change the period effect to −6: the estimate is still −5.7 and the expected value still −6 (without noise, 0 in the A-first group and −12 in the B-first group). That is thanks to splitting the orders half and half. (3) Put the period effect back to −2, set carryover to 60% and washout to 0 weeks: the estimate is −3.9 (expected −4.2), so the effect looks smaller. The bias of 1.8 is 6 × 0.6 ÷ 2. (4) Make the washout 1, 2 and 4 weeks: A's leftover effect drops to 30%, 15% and 3.8%, and the expected estimate moves toward −6: −5.1, −5.55, −5.89.

Why the period effect cancels but carryover does not

Let τ (tau) be the true difference between A and B, "period" the change everyone gets in period 2, and "carryover" the leftover A effect in the A-first group's period 2 (on B). Without noise, the (A − B) of each group is:

A-first groupB-first groupAverage of the two
On Abase + τbase + period + τ
On Bbase + period + carryoverbase
A − Bτ − period − carryoverτ + periodτ − carryover ÷ 2

The period effect enters with a minus in one group and a plus in the other, so it cancels in the average. Carryover is only in the A-first group, so half of it stays. If the leftover pushes the same way as the treatment, carryover makes the effect look smaller than it is. Each person's base level drops out when you take A − B.

Carryover is hard to detect from the data. In a 2×2 design, carryover cannot be told apart from the treatment-by-period interaction, and the comparison that measures it is between people (one order group against the other), so it carries all the between-person variation and has little power (ICH E9, 3.1.2). That is why carryover is prevented in the design rather than checked in the data.

When a crossover design worksWhen it does not
Long-lasting, stable conditions (chronic): period 1 and period 2 start from the same placeIllnesses that get cured and end (like infections): if people recover in the first period, there is nothing to compare in the second
The treatment's effect builds up fully within the period and fades soon after stoppingTreatments whose effect lasts a long time (surgery, a shot that works for a long time, training)
The washout can be long enough for the effect to wear off completelyThe condition gets worse or better quickly, so each period starts from a different place
Example: bioequivalence studies (do two drugs with the same ingredient reach the same amounts in the body?)Long studies where many people are likely to drop out between periods

These conditions are stated in the crossover section of ICH E9: the condition should be chronic and stable, the drug's effects should develop fully within the treatment period, and the washout should be long enough for the drug's effect to reverse completely.

8. Counting similar values as if they were separate

Measure one person 10 times and you get 10 values, but those 10 share the same person's base level, so they are alike. Analyze them as if 10 different people were measured once each, and the standard error comes out smaller than it really is, and the p-value gets falsely small. Textbooks call this pseudoreplication.

We made the two groups with no difference at all (5 people per group, between-person standard deviation 5, within-person standard deviation 5). "Counted separately" puts the 5 × m measurements of each group into a Welch t-test as if they were different people. "Per-person means" puts in the 5 per-person means of each group. Both analyses look at the same 2,000 data sets. "Another data set" only changes the data in the left picture.

Try this. (1) At the start (m = 10), counting separately gives p < 0.05 in 836 of 2,000 runs (41.8%), while per-person means give 88 (4.4%). There is no effect, so about 5% is the right answer. (2) Lower m to 1: the two analyses become the same, both 5.0%. (3) Raise m to 20: the separate count climbs to 57.8%. The more you measure each person, the more often the wrong analysis is fooled. (4) The data set in the starting picture gives p = 0.087 counted separately and 0.292 with per-person means. Press "Another data set" three times: p = 0.005 counted separately, but 0.307 with per-person means.

Why. If you measure one person m times and average, the variance of that average is between-person variance + within-person variance ÷ m. Raising m only shrinks the second part. The between-person part only shrinks with more people. The separate count acts as if both parts were divided by the number of measurements, so its standard error is too small. By how much is roughly 1 + (m − 1) × ICC, called the design effect. This lab has ICC = 0.5 (between 5², within 5²), so at m = 10 it is 5.5: the variance is understated 5.5 times and the standard error √5.5 ≈ 2.3 times.

The sample size is the number of people, not the number of measurements. Measuring more often only makes each person's value more precise. Average per person before the analysis, or use an analysis that treats each person as a cluster (the mixed model in section 9).

Clustered data has the same problem. Patients from the same hospital (each hospital has its own way of treating and its own kind of patients, so they are alike), the two eyes of one person, many cells from one animal, cells grown in the same dish, students in the same class. "What was randomized?" is the unit of analysis. If whole hospitals were assigned to treatments (cluster randomization), the information you really have is less than the number of patients suggests, and the more alike patients within a hospital are, the closer it shrinks toward the number of hospitals. A familiar example for developers: in an A/B test, counting thousands of clicks from one user as if they were thousands of users is the same mistake.

9. Three or more time points, and missing data

With three or more time points (weeks 0, 4, 8, 12), one paired t-test is not enough. Two methods are common. Repeated-measures ANOVA treats time as a factor and each person like a block, which pulls out the between-person variation (analysis of variance, blocking). It needs the assumption that the differences between every pair of time points have the same variance (sphericity); when that fails, the degrees of freedom are reduced to correct for it. A mixed model writes the idea "give each person their own base level" straight into the formula. The value = 140 + this person's offset + change + noise from section 1 is exactly that shape, and each person can get their own slope too. It can use every value that is there, even when people are measured at different times or some values are missing. This page shows only the idea of the mixed model; it does not cover how the numbers are estimated (maximum likelihood and so on).

Adjusting for the starting value. When comparing two groups in a trial, you can put the starting value (baseline) into the regression together with the group and compare the final values. This is called analysis of covariance (ANCOVA) (correlation and regression). In a randomized trial it usually has more power than comparing the change scores (final − start) or only the final values, and when the starting and final values are very highly correlated, its advantage over the change score gets small (Vickers and Altman).

Missing data. Ask people to come back many times and some stop coming. The paired t-test only uses people who have both values, so it drops anyone who left. If the reason people left has nothing to do with the outcome, you just lose some precision. But if many people quit because the drug was not working, an analysis of only those who stayed is biased in the drug's favor. A mixed model, if the model is right, still estimates correctly when the reason for leaving is explained by values already measured, but if people left because of something never measured (how they were after leaving), no analysis can fix it from the data alone. So record why people left, and first design to reduce dropouts (shorter studies, fewer visits).

Where it is used

Frequently asked questions

How do I choose between a paired t-test and an independent t-test?

By how the data was collected. If the same people (or people matched in pairs ahead of time) were measured twice, use the paired t-test. If the two groups are different people, use the independent t-test. Do not run both and keep the one with the smaller p-value.

If I measure each person many times, can I recruit fewer people?

More measurements make each person's value more precise, but they do not change how much people differ from each other. If the question is whether the treatment works for people, the sample size is the number of people. 1,000 measurements from 10 people is a sample of 10.

Is the paired analysis always better?

It helps when the two values from the same person are alike (a positive correlation). With a correlation of 0 there is nothing to gain and you only lose degrees of freedom; with a negative correlation it is worse. Still, if the data comes in pairs, use the paired analysis because it matches how the data was collected.

When can a crossover design not be used?

For illnesses that get cured and end (if people recover in the first period, there is nothing to compare in the second), for treatments whose effect lasts a long time, and when the condition changes a lot from one period to the next. Carryover is hard to detect from the data, so it is prevented in the design with a long enough washout period.

If the paired p-value is 0.002, is there a 99.8% chance the drug works?

No. A p-value is the chance of seeing a difference this big or bigger by luck alone if there were no effect. It is not the chance that there is an effect, and it is not the size of the effect. For size, look at the mean difference and its confidence interval. In a before-and-after study of a single group, you also have to ask whether the drop came from the drug or just from time passing.

Words

Plain words used hereTextbook term
Measuring the same people more than onceRepeated measures, within-subject design. Measured over time: longitudinal data
One line per personSpaghetti plot, individual profiles
Between-person / within-person variationBetween-subject variation / within-subject variation
How alike one person's values areIntraclass correlation (ICC)
Comparing before and after in pairsPaired t-test
Comparing two groups of different peopleIndependent two-sample t-test. Without assuming equal variances: Welch's t-test
How much the mean difference wobblesStandard error (SE)
Everyone gets both treatments in turnCrossover design. Two orders × two periods: 2×2 crossover (AB/BA)
A first, B firstSequence
The break in betweenWashout period
A change everyone gets in the later periodPeriod effect
An earlier treatment spilling into the next periodCarryover effect
Order, practice and tiredness getting mixed inOrder effect, practice effect, fatigue effect
Coming back toward the averageRegression to the mean
Counting similar values as separatePseudoreplication
How many times the variance was understatedDesign effect
Grouped data, assigning whole groupsClustered data, cluster randomization
A model that gives each person their own base levelMixed model, mixed-effects model. Each person's base level is a random intercept
Analysis of variance with several time pointsRepeated-measures ANOVA. Its assumption: sphericity
Adjusting for the starting valueAnalysis of covariance (ANCOVA)
Missing values, people who stop comingMissing data, dropout
A trial comparing two drugs with the same ingredientBioequivalence study

Sources

← ANCOVAConfounding and bias →