When we want to know if a treatment changes an outcome, like whether a new running shoe makes people faster, large baseline differences from person to person can easily hide a small improvement.
1
Subtracting Out Person-to-Person Differences
We want to find out whether a new carbon-plated shoe saves a few seconds on a 400-meter lap, even when our runners range from a 58-second track star to a 92-second casual jogger.
Subtracting Out Person-to-Person Noise
Once we subtract each runner's New Shoe time from their Old Shoe time across the row, the starting speed of each runner cancels out, leaving a single list of five time differences:
rowdifferenced=Old−New⟹3,0,6,2,4 seconds
Even when the runners have very different starting speeds, so the separate Old Shoe and New Shoe columns spread out wide and overlap, the row differences d=Old−New stay the same.
Changing how fast a runner is spreads out and overlaps the Old Shoes and New Shoes times, while each runner's difference stays the same.
2
Hypotheses and Conditions for Paired Data
From our single list of five differences, we want to test whether the true average difference μd is zero or shows a real speedup, and check that our study design allows a one-sample t-test and confidence interval.
Hypotheses and Conditions for Paired Data
d:3,0,6,2,4
d=Old−New
H0Ha:μd=0:μd?0
Because getting faster makes the New time smaller than the Old time, our subtraction d=Old−New turns an improvement into a positive number:
H0:true averagedifferenceμdHa:μd=0(the shoes make nodifference on average)>0where d=Old−New
Always write how you subtracted (such as d=Old−New) right next to μd so it is clear why the inequality in Ha points the way it does.
Before using the t-distribution on n=5 pairs, we check how the data were collected and what the sample of differences looks like:
Independent pairs: One runner's lap times do not affect another runner's times.
Randomness: What kind of randomness we have decides what we can claim at the end. A random sample of runners lets us generalize to a larger population, while flipping a coin to randomize who wears which shoe first mixes up any warm-up or fatigue effect so we can conclude the shoes caused the speedup for these runners.
Nearly normal differences: With only n=5 pairs (well below the n≥30 cutoff), a single outlier would throw off both the sample average and standard deviation, so we check a dotplot of the differences for heavy skew or outliers.
3
Paired t-Test and Confidence Interval
Now we want to measure how many standard errors our sample average dˉ=3 seconds is above the H0 value of 0, and build a confidence interval for the average time saved per lap.
Now we run a regular one-sample t-test and confidence interval on the single list of differences, where n is the number of pairs, not the total number of individual lap times:
SEtdˉ=pairsnsdSD of the ndifferences,=SEdˉ−0,±t∗⋅SE(df=n−1)
Paired t-Test and Confidence Interval
Text solution
Sample mean and standard deviation of the differencesAverage the n=5 row differences, then use each difference's distance from dˉ=3 to find the sample standard deviation sd.
Standard Error and t-scoreDivide the individual spread sd by 5 to find how much a 5-pair average varies from sample to sample, then count how many standard errors dˉ=3 sits above 0.
SE=nsd=55=1 second
t=SEdˉ−0=13−0=3(df=5−1=4)
On a t-curve with df=4, the tail above t=3 has area p≈0.02, which is below 0.05, so we reject H0 and conclude that the new shoes caused a speedup for runners like these.
95% confidence interval for μdStart at our best estimate dˉ=3 seconds and go out t∗=2.78 standard errors in each direction (for 95% confidence with df=4).
dˉ±t∗⋅SE=3±2.78(1)=3±2.78=(0.22,5.78) seconds
We are 95% confident that the new shoes save an average of 0.22 to 5.78 seconds per lap for runners like these. Because 0 is outside that interval, the interval and the test give the exact same conclusion.
With only n=5 pairs, a single difference far below the others makes the Standard Error much larger, which shrinks the t-score, pushes the p-value above 0.05, and stretches the 95% confidence interval across 0, even when the other four runners all improved.
With only 5 pairs, a single outlier widens the standard error enough to stretch the confidence interval across 0 and undo the evidence, even when the other four runners all got faster.
4
How to Spot Paired Data
In a real problem, a two-column table won't have "paired data" printed at the top, so we need a quick way to decide whether to subtract across the rows or treat the columns as two separate groups.
How to Spot Paired Data
If we scramble the second column of the shoe table, the two column averages stay at 74 and 71 seconds, but the scrambled rows now compare two different runners and ruin the differences d.
Mixing up the New Shoes column keeps the column averages at 74 and 71 seconds, but breaks the swapped runners' pairs, so their row differences now include the speed gap between two different runners.
Key concepts
When you are handed two columns of measurements, your first decision is to test the link across a row by asking what happens if you shuffle the second column:
When to pair (scrambling ruins the data)
Each row links the same person (before and after, or left arm vs. right arm), matched partners (identical twins), or the same item (the price of milk at Store A vs. Store B). Pick a subtraction order such as d=Old−New, subtract across each row, cross out the original columns, and run a one-sample t-test or confidence interval on the n differences with df=n−1:
H0:μdSEtdˉ=0,=nsd,=SEdˉ−0,±t∗⋅SE
When not to pair (scrambling changes nothing)
If 50 people take Aspirin and 50 different people take Tylenol, Person 1 in the first column has no connection to Person 1 in the second column. Even though both columns have 50 numbers, subtracting across rows is meaningless. Treat them as two independent samples.
Checking what you can claim
Flipping a coin to randomize treatment order within each pair cancels out warm-up or order effects so you can claim causation, while taking a random sample of pairs from a population is what lets you generalize to that larger group. When n<30 pairs, always plot the differences d to make sure no outlier or heavy skew is throwing off dˉ and sd.
5
Practice
1
For each study, decide whether the two columns of numbers are paired data or two independent samples, and explain how the "scramble the second column" test tells you: (a) A consumer group records the price of the exact same 15 household items at Store A and Store B. (b) A clinic randomly assigns 40 patients to take Aspirin and 40 different patients to take Ibuprofen, recording minutes until headache relief. (c) A researcher tests two sunscreens on 12 volunteers by flipping a coin for each person to put Brand X on one arm and Brand Y on the other arm.
Look at Row 1 in each table and ask whether the two measurements come from the same item or person, or from two unrelated people who just happened to be listed first.
(a) Paired dataEach row links the same grocery item at both stores, so scrambling the Store B column would compare different items (such as milk to eggs).
(b) Two independent samplesWatch out: Equal sample sizes (40 and 40) often tempt people to pair the columns, but Person 1 in the Aspirin column has no link to Person 1 in the Ibuprofen column, so scrambling the second column changes nothing.
(c) Paired dataEach row links the left and right arms of the same volunteer, so scrambling the second column would mismatch arms from different people.
2
Eight students take a typing test (in words per minute) before and after a keyboarding course to see if the course increases typing speed. Student A subtracts d=After−Before and finds a sample average of dˉ=+6.5 wpm. Student B uses the exact same table of data but subtracts d=Before−After. Write H0 and Ha for both students, find Student B's dˉ, and explain how their final conclusions compare.
If a student types faster after the course, which number is larger: After or Before? Check whether Before−After comes out positive or negative when speed increases.
For Student A (d=After−Before), getting faster makes After larger than Before, so:
H0:μdHa:μd=0,>0(where d=After−Before)
For Student B (d=Before−After), getting faster makes Before smaller than After, which flips the sign of every difference:
Watch out: The most common mistake is flipping the subtraction to Before−After (dˉ=−6.5) while leaving Ha:μd>0 pointing to the right, which looks in the wrong tail and gives a p-value above 0.5. Because Student B gets a t-score of the opposite sign and flips the inequality in Ha to the opposite direction, both students get the exact same tail area (p-value) and reach the same conclusion.
3
To test whether a new drug lowers resting heart rate (in beats per minute), 5 patients each have their heart rate measured once on a placebo and once on the drug, with a coin flip deciding the order for each patient. Their rates (Placebo, Drug) are: Patient 1 (64, 60), Patient 2 (88, 90), Patient 3 (75, 65), Patient 4 (54, 52), and Patient 5 (99, 93). Using d=Placebo−Drug, find the 5 differences, dˉ,sd, the Standard Error, the test statistic t, and the degrees of freedom for testing H0:μd=0 versus Ha:μd>0.
Subtract across each row first to get a single list of 5 numbers, and remember that n is the number of patients (pairs), not the 10 individual heart-rate measurements.
Subtracting across each row (Placebo−Drug) gives the 5 differences:
4,−2,10,2,6 bpm
The sample mean is:
dˉ=54−2+10+2+6=4 bpm
Each difference's distance from dˉ=4 gives 0,−6,+6,−2,+2, and their squares are 0,36,36,4,4, which add up to 80.Watch out: Divide the sum of squares by n−1=4, not by n=5 (which would mistakenly give sd=16=4 bpm):
sd=5−180=20 bpm
Next, divide sd by n=5 to get the Standard Error (forgetting 5 and plugging sd=20 directly into the t-score is a common mistake that gives t≈0.89):
SE=nsd=520=2 bpm
Finally, use the n=5 pairs (not the 10 total measurements, which would wrongly give df=9) to find t and the degrees of freedom:
t=24−0=2,df=5−1=4
4
Researchers study 9 pairs of identical twins (18 people in all) to compare two diets. Within each pair, a coin flip assigns one twin to Diet A and the other to Diet B for a month. At the end of the month, cholesterol levels (in mg/dL) are summarized as follows: Diet A column has mean 195 and SD 28; Diet B column has mean 189 and SD 31; row differences (d=Diet A−Diet B) have dˉ=6 and sd=9. Using the right 95% critical value (t∗=2.31 for df=8,t∗=2.26 for df=9, or t∗=2.11 for df=17), build a 95% confidence interval for μd and state whether it gives convincing evidence at the 5% level that the diets produce different average cholesterol levels (Ha:μd=0).
Do not use the 18 total people for n=18 and df=17 (t∗=2.11), which shrinks the interval to 6±4.48=(1.52,10.48) and leads to the wrong conclusion.
Cross out the separate column summaries for Diet A and Diet B. How many linked pairs of differences are there, and what does that make n and df?
Ignore the separate column standard deviations (28 and 31), which include baseline differences from family to family, and work only with the n=9 pairs of differences. Watch out: Do not use the 18 total people for n=18 and df=17 (t∗=2.11), which shrinks the interval to 6±4.48=(1.52,10.48) and leads to the wrong conclusion; and don't forget to subtract 1 from n=9 pairs. With n=9 pairs, df=9−1=8, so t∗=2.31 and the Standard Error is:
SE=nsd=99=3 mg/dL
The 95% confidence interval is:
dˉ±t∗⋅SE=6±2.31(3)=6±6.93=(−0.93,12.93) mg/dL
Because 0 is inside the interval (−0.93,12.93) mg/dL, we do not have convincing evidence at the 5% level that the true average difference is anything other than 0.
5
A teacher wants to know if background music helps students solve logic puzzles faster. She asks 6 volunteers from her math club to solve Puzzle A in silence first, and right afterward solve an equally difficult Puzzle B with music playing. Five students finish 3 to 7 seconds faster with music, while the 6th student drops his pencil and finishes 48 seconds slower with music. Identify three flaws that prevent the teacher from using a paired t-test on these data to claim that music causes all students at her school to solve puzzles faster, and state how to fix the study design.
Check the normality condition for n=6 pairs, ask what else besides music changed between the first and second puzzle, and look at how the 6 students were chosen from the school.
Normality condition fails (n<30 with an outlier)With only n=6 pairs, the −48-second outlier violates the normality condition and throws off both dˉ and sd. (Watch out: Plugging all 6 numbers blindly into the formula pulls dˉ negative and makes sd huge, even though 5 of the 6 students improved.)
No random assignment of order (cannot claim causation)Because every student solved the silent puzzle first and the music puzzle second, a warm-up or practice effect is mixed in with the music. To fix this and test causation, she must flip a coin for each student to randomize who gets music first and who gets silence first.
No random sample of students (cannot generalize to the school)Watch out: Even if she flips a coin for puzzle order, random assignment does not fix a volunteer sample. Because she used 6 volunteers from the math club, she cannot generalize her results to the whole school; to fix this, she must take a random sample of students from the school.