The chapter's last section changes the design rather than the parameter. The three previous tests all required the two samples to be independent, and here they are not: two measurements are drawn from the same pair of individuals or objects, so a subject who scores high on the first will tend to score high on the second. The remedy is to calculate a difference for each pair, and those differences become the data. The population mean of the differences is then tested using a Student t test for a single population mean with n minus one degrees of freedom, where n is the number of differences — which is chapter 9's one-sample test applied to a single column of numbers. The design has a real advantage beyond correctness: because each subject serves as their own control, the variation between subjects is cancelled and only each subject's own change remains to be analysed.
Subject: Statistics · 67 slides · symbolic lesson
Open the interactive version of this deck
Title
Statistics · Chapter 10 — Hypothesis Testing with Two Samples
Two measurements on the same subjects: subtract, then test one column
Objectives
Sections 10.1 to 10.3 compared two groups that had nothing to do with each other. This section is about the case where every measurement in one sample has a partner in the other: the same person before and after, or the same student with each hand. That link changes the method, and the change makes the problem easier, not harder.
Almost every mistake in this section happens before any arithmetic: treating linked data as independent, subtracting in one direction and writing the hypothesis for the other, or counting measurements instead of pairs. Each has its own slide, and each has a one-line check you can carry into any problem.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 527-532 — the section this deck covers
Warm-up
This section ends up reusing Section 9's one-sample t test almost unchanged, so start by running it once. Keep the steps in mind: estimate, standard error, statistic, degrees of freedom.
Discussion prompt
A sample of 9 values has mean 52 and standard deviation 6. Test the null hypothesis that the population mean is 48 against the alternative that it is greater. Find the standard error, the t statistic and the degrees of freedom.
Hold on to that shape: an estimate minus a hypothesised value, divided by a standard error built from one standard deviation and one sample size. By Part 4 the paired test will look exactly like this, with the differences playing the part of the nine values.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §9.4-9.5, recalled in §10.4, p. 528 — the one-sample t test with n − 1 degrees of freedom
Section
Part 1
Concept
Example 10.11 asks whether hypnotism reduces pain. Eight subjects had their sensory pain measured, then were hypnotised and measured again. A lower score means less pain. Here is every subject's pair of scores, joined by a line.
Figure (svg): A slope chart for Example 10.11. Two vertical columns of eight dots, before hypnotism on the left and after on the right, on a scale from 0 to 12. Each subject's two dots are joined by a line. Seven lines slope downward and are blue; subject A's line rises slightly, from 6.6 to 6.8, and is orange. Subject H falls furthest, from 11.6 to 2.0.
Look at what the lines show that the two columns alone do not. The before column runs from 6.3 to 11.6 and the after column from 2.0 to 8.5, and those ranges overlap a lot. But follow each person: seven lines fall and only subject A's rises, by a fifth of a point. The evidence is in the slopes.
The book lists what such a study looks like: simple random sampling, sample sizes that are often small, and two measurements drawn from the same pair of individuals or objects. Differences are calculated from the pairs, and those differences form the sample that is tested.
matched or paired samples — Two samples in which each observation in one is linked to exactly one observation in the other, because both come from the same individual or from two individuals deliberately matched. The analysis works on the difference within each pair.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 527-528 — the characteristics of a matched-pairs test, and Table 10.14
Concept
The tests in Sections 10.1 to 10.3 assumed the two samples were independent: knowing a value in one sample told you nothing about any value in the other. Paired data break that assumption in a predictable way. Example 10.13's seven eighth graders show it clearly.
Figure (svg): A scatter plot of the seven shot-put students, dominant-hand distance on the horizontal axis and weaker-hand distance on the vertical, both from 12 to 36 feet. A dashed diagonal line marks equal distances. Six points lie on or below the line. The points rise from lower left to upper right; the correlation is 0.73.
Each dot is one student: how far they pushed the shot-put with their dominant hand across, and with their weaker hand up. The dots climb together, with correlation 0.73. A student who is strong with one hand is strong with the other, so the two columns are linked student by student.
The independent-samples formula adds the two groups' variances as if each column wobbled on its own. Here they wobble together, and the formula cannot see that. Its standard error is wrong for these data, and so is everything built on it, from the statistic to the p-value.
The fix is not a new formula with a correlation in it. It is to stop looking at two columns at all. Subtract within each student, and the shared strength cancels out of every difference.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 531-532 — Example 10.13 and Table 10.19
Concept
A design is paired whenever every observation has one particular partner. That happens in two ways, and both are analysed in exactly the same way.
Figure (svg): Three panels. Left, independent groups: six orange dots and five blue dots in two separate clouds with no lines between them. Middle, the same subject twice: five people labelled A to E, each with an orange before dot joined by a yellow line to a blue after dot. Right, matched subjects: four pairs of an orange treatment dot and a blue control dot, each pair joined by a yellow arc, labelled matched on age and health.
The first is the same subject measured twice: before and after a treatment, or under two conditions, like the shot-put with each hand. All three of the book's examples are this kind. The person is their own comparison, which is why such designs are said to let each subject serve as their own control.
The second is matching: two different subjects, alike in whatever matters, with one assigned to each condition. Twins split between two teaching methods, or patients paired on age and severity before one of each pair gets a new drug. They are different people, but their results are linked by the matching.
The left panel is what pairing is not. Two separate groups, even of the same size, have no partner structure, and the order the values happen to be listed in means nothing. Lining them up and subtracting would be inventing pairs that the design never made.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 527 — two measurements drawn from the same pair of individuals or objects
Sorting
For each study, ask one question: does every observation in one sample have a particular partner in the other? If so, the design is paired, and you will subtract within pairs. If the two samples could be shuffled without losing anything, they are independent.
Sort into buckets
Sort each study by its design.
Notice that every paired study on the list has a natural unit, a person, a patient, a family or a car, that carries both measurements. Find that unit and you have found the pairs. The batteries are the instructive one. Twenty and twenty look like they could be lined up, but battery 7 of brand A has no connection to battery 7 of brand B. Equal sample sizes are necessary for pairing but never sufficient; what makes a pair is a shared subject.
The eyes are worth a second look as well: two measurements on one patient share that patient's age, health and genetics, so they are as linked as a before and an after. The tyres are the subtle one. Putting both brands on the same car means both face the same driver, roads and weather, so the comparison is within a car. That is matching, and engineers design tyre tests this way on purpose.
Step zero
Example 10.13 records 14 distances: seven students, each throwing with the dominant and the weaker hand. Before touching the data, decide what the sample size is for the test, and so how many degrees of freedom it has.
Discussion prompt
Seven students each push the shot-put with both hands, giving 14 distances. What is n for the paired test, how many degrees of freedom does it have, and why is 14 the wrong count?
This is the first decision in every paired problem, and it is made from the design, not from the numbers. The book says it plainly: n is the number of differences. Write it down before anything else, because every later step uses it.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 528 — n − 1 degrees of freedom, where n is the number of differences
Trap
Given Example 10.13's two columns, a first attempt reaches for Section 10.1:
\[ t = \frac{24.57 - 20.86}{\sqrt{\frac{6.21^2}{7} + \frac{5.90^2}{7}}} \]
\[ t = \frac{3.71}{3.239} = 1.15 \]
Wrong design. Welch then gives p = 0.274.
The columns are linked student by student, so their variances do not simply add. Subtract within each student first:
\[ \text{SE} = \frac{s_d}{\sqrt{n}} = \frac{4.499}{\sqrt{7}} = 1.700 \]
\[ t = \frac{3.714}{1.700} = 2.184 \]
The paired p-value is 0.0716. The independent formula nearly doubled the standard error by counting the students' strength as noise. Ask whether values have partners before choosing a test.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 532 — Example 10.13
Prediction
You have just seen Example 10.13 analysed both ways. Now predict the general pattern before Part 5 explains it. Think about what happens to the students' differences in strength under each analysis.
Predict first
When the two measurements on each subject are strongly positively correlated, how does the paired standard error compare with the independent-samples standard error on the same data?
Correct: The paired one is smaller
Why: With a strong positive correlation, the differences cancel the variation between subjects, so they vary much less than either column. The independent formula leaves that variation in, so its standard error is larger and its test is weaker.
\[ \text{paired SE} = 1.700 \qquad \text{independent SE} = 3.239 \]
Think of it this way: under the independent analysis, the gap between a strong student's dominant throw and a weak student's weaker throw counts as noise, though it says nothing about hands. The word strongly is doing the work. Part 5 shows that the size of the saving depends on how closely the two measurements move together, and finds one of the book's own data sets where pairing saves nothing at all.
Remember, though, that the choice is not yours once the data exist. Paired data must be analysed as paired; the comparison only shows what the design bought.
Section
Part 2
Concept
For each pair, subtract one measurement from the other. For Example 10.11 the book subtracts before from after, and that choice must be made once and used for every subject.
\[ d_i = \text{after}_i - \text{before}_i \]
| subject | before | after | after − before |
|---|---|---|---|
| A | 6.6 | 6.8 | 0.2 |
| B | 6.5 | 2.4 | −4.1 |
| C | 9.0 | 7.4 | −1.6 |
| D | 10.3 | 8.5 | −1.8 |
| E | 11.3 | 8.1 | −3.2 |
| F | 8.1 | 6.1 | −2.0 |
| G | 6.3 | 3.4 | −2.9 |
| H | 11.6 | 2.0 | −9.6 |
Now read the signs in context. A lower score means less pain, so after minus before is negative when the subject improved. Seven of the eight are negative. Subject A's 0.2 is the one person who felt slightly more pain afterwards.
Figure (svg): A number line from minus 10 to 2 with eight dots for the hypnotism differences, after minus before. Seven dots are blue and lie left of zero, from minus 9.6 to minus 1.6; one orange dot sits at 0.2. A dashed vertical line marks zero, labelled no change, and a yellow dashed line marks the mean, minus 3.125.
From here on, the before and after columns play no further part. The book says it in four words: the differences are the data. Everything the test needs is in that one row of eight numbers.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 528 — Table 10.15 and the instruction to calculate after minus before
Concept
Turning sixteen scores into eight differences loses information on purpose. It is worth being clear about what goes, because it tells you which questions a paired test can and cannot answer.
\[ \text{subject H: } (11.6, \; 2.0) \;\to\; d = -9.6 \]
What is kept is the change within each subject: its size and its direction. What is thrown away is the level each subject started from. Subject H began at 11.6 and subject G at 6.3, and after subtraction nothing records that H was in far more pain to begin with.
That loss is the point. The starting level is exactly the between-subject variation that would otherwise blur the comparison. Discarding it is what lets eight people with very different pain thresholds be compared fairly, each against themselves.
\[ \bar{x}_d = \bar{x}_{\text{after}} - \bar{x}_{\text{before}} \]
One thing is not lost: the mean of the differences always equals the difference of the two column means, because averaging and subtracting can be done in either order. What changes is the standard deviation. The spread of the differences is not the difference of the spreads, and it is usually much smaller than either.
So a paired test can say whether subjects changed on average, and by about how much. It cannot say whether the after scores are high or low in absolute terms; for that you would look at the after column itself.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 528 — the differences form the sample used for the test
Worked example
The hypnotism study's before and after scores are given in Table 10.14. Form the differences, after minus before, and read what their signs say.
Each line is one subtraction. Keep the order identical every time; a single pair done the other way round would flip that person from improving to worsening and quietly corrupt every number after it.
Subjects A and B
Why: after minus before, keeping the sign.
\[ 6.8 - 6.6 = 0.2, \qquad 2.4 - 6.5 = -4.1 \]
Subjects C and D
Why: both fell.
\[ 7.4 - 9.0 = -1.6, \qquad 8.5 - 10.3 = -1.8 \]
Subjects E and F
Why: the same order again.
\[ 8.1 - 11.3 = -3.2, \qquad 6.1 - 8.1 = -2.0 \]
Subjects G and H
Why: H shows the largest drop.
\[ 3.4 - 6.3 = -2.9, \qquad 2.0 - 11.6 = -9.6 \]
Pause on subject H. A drop of 9.6 points is three times the size of anyone else's change, and it will dominate both the mean and the standard deviation. It is a real observation, so it stays; but keep it in mind when you judge how much eight subjects can say.
Collect the data for the test
Why: one value per subject.
\[ \{0.2, -4.1, -1.6, -1.8, -3.2, -2.0, -2.9, -9.6\} \]
In context: seven of the eight subjects reported less pain after hypnotism, by amounts from 1.6 to 9.6 points, and one reported 0.2 points more. These eight numbers, not the sixteen scores, are what the test analyses.
Check against the column means
Why: the mean of the differences must equal the difference of the column means.
\[ \bar{x}_{\text{after}} - \bar{x}_{\text{before}} = 5.5875 - 8.7125 = -3.125 = \frac{-25}{8} \]
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 528 — Example 10.11, Tables 10.14 and 10.15
Worked example
The book gives the summary values of the eight differences and says: verify these values. Do it, one move per line, using the definition of the sample standard deviation from Chapter 2.
The plan: add the differences and divide by eight for the mean; subtract the mean from each difference and square; add the squares, divide by n minus one, and take the square root.
Add the eight differences
Why: signs included.
\[ 0.2 - 4.1 - 1.6 - 1.8 - 3.2 - 2.0 - 2.9 - 9.6 = -25.0 \]
Divide by n = 8
Why: the sample mean difference.
\[ \bar{x}_d = \frac{-25.0}{8} = -3.125 \]
Deviations from the mean
Why: each difference minus minus 3.125.
\[ 3.325, \; -0.975, \; 1.525, \; 1.325, \; -0.075, \; 1.125, \; 0.225, \; -6.475 \]
A quick check before squaring: deviations from a mean always add to zero, and these do. Five are positive and three negative, but subject H's minus 6.475 balances the rest. The squares will make every deviation count as a positive amount of spread.
Square and add
Why: the squared deviations, totalled.
\[ 11.056 + 0.951 + 2.326 + 1.756 + 0.006 + 1.266 + 0.051 + 41.926 = 59.335 \]
Figure (svg): Eight horizontal bars, one per subject A to H, each running from the mean difference, minus 3.125, to that subject's difference. Bars to the right are orange, bars to the left blue. Beside each bar its squared deviation is printed; subject H's bar is by far the longest, with squared deviation 41.926. The squares total 59.335.
Divide by n minus 1
Why: seven, because the deviations were measured from a mean estimated from these same eight values.
\[ s_d^2 = \frac{59.335}{7} = 8.4764 \]
Take the square root
Why: back to points.
\[ s_d = \sqrt{8.4764} = 2.9114 \]
In context: the eight subjects' changes average a drop of 3.125 points, and a typical subject's change sits about 2.9 points from that average. Most of that spread comes from subject H's very large drop. The book rounds these to minus 3.13 and 2.91.
Check with the shortcut
Why: the sum of squared deviations also equals the sum of squares minus the total squared over n.
\[ \Sigma d^2 - \frac{(\Sigma d)^2}{n} = 137.46 - \frac{625}{8} = 137.46 - 78.125 = 59.335 \]
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 528-529 — Example 10.11: the sample mean and standard deviation of the differences
Fill the middle
Try It 10.11 tests a diet meant to lower cholesterol in nine subjects. Use after minus before, as in Example 10.11. Fill in the missing differences, then the total. Subject A went from 209 to 199.
| subject | A | B | C | D | E | F | G | H | I |
|---|---|---|---|---|---|---|---|---|---|
| before | 209 | 210 | 205 | 198 | 216 | 217 | 238 | 240 | 222 |
| after | 199 | 207 | 189 | 209 | 217 | 202 | 211 | 223 | 201 |
Fill in the blanks
d_A = -10, \; d_B = -3, \; d_C = -16, \; d_D = 11, \; d_E = 1, \; d_F = -15, \; d_G = -27, \; d_H = -17, \; d_I = -21, \quad \Sigma d = -97
Why: Subject C went from 205 to 189, a change of minus 16; D went from 198 up to 209, plus 11; G went from 238 to 211, minus 27. Adding all nine differences gives minus 97, so the mean change is minus 97 over 9, about minus 10.78.
Notice subject D: the only one whose cholesterol rose by a lot, eleven points. Keep the plus sign. If you had written it as a drop because most of the others were drops, the total would be off by 22 and every later number with it.
You will run the full test on these nine differences in Part 4. For now the point is the habit: one direction, every pair, signs kept exactly as the subtraction gives them.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 530 — Try It 10.11 and Table 10.16
Error analysis
A student summarises Example 10.11's differences like this. Every arithmetic step is correct, and the answer is still useless for the question asked. Find where it went wrong.
Annotate
On: \( |d_i| = 0.2, 4.1, 1.6, 1.8, 3.2, 2.0, 2.9, 9.6 \;\Rightarrow\; \bar{x} = 3.175 \)
The error looks like neatness, which is why it survives. A difference has a size and a direction, and the test is about the direction: is the average change below zero? Strip the signs and that question can no longer be asked.
A related slip is subtracting the smaller number from the larger in each pair, so that every difference is positive. That is the same mistake in another form. The direction of subtraction is fixed by the problem, never by which number happens to be bigger.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 528 — Example 10.11
Picture it
Try It 10.11's nine subjects can be drawn so that each difference is a visible length. Put cholesterol before on the horizontal axis and after on the vertical, and draw the line where after equals before.
Figure (svg): A scatter plot of the nine cholesterol subjects: cholesterol before the diet on the horizontal axis and after on the vertical, both from 185 to 245. A dashed diagonal line marks no change. Seven points lie below the line, joined to it by short vertical blue segments; two lie above it, joined by orange segments. The length of each segment is that subject's difference.
A subject on the dashed line did not change. A subject below it ended lower than they started, and the vertical segment from the dot to the line is exactly their difference, after minus before. Seven segments hang below the line and two rise above it.
This picture also shows why pairing works. The dots are spread from about 198 to 240 along the line, because people start with very different cholesterol. That spread runs along the line, and the differences measure only the distance from it.
The paired test asks one question of this picture: on average, do the points lean below the no-change line by more than chance would produce? Which side of the line you call negative is set by the order of subtraction.
Prediction
Suppose Example 10.11 had been worked as before minus after instead of after minus before. Predict the consequences before reading on.
Predict first
If every hypnotism difference is computed as before minus after, what happens to the mean difference, the standard deviation and the p-value?
Correct: The mean becomes plus 3.125, the standard deviation is unchanged, and with the alternative flipped the p-value is the same
Why: Reversing the order multiplies every difference by minus one. The mean flips sign, but the spread does not depend on direction. Improvement is now a positive difference, so the alternative becomes greater than zero, and the right tail beyond plus 3.04 has the same area as the left tail before.
\[ \bar{x}_d = +3.125, \quad s_d = 2.9114, \quad t = +3.036, \quad p = P(t_7 > 3.036) = 0.0095 \]
So the direction is a free choice, but a binding one. Choose it, write it down, and let it decide the sign that means improvement. Every error in this part of the section comes from choosing one direction and then writing the hypothesis for the other.
Section
Part 3
Concept
Once the differences are the data, the question is about the mean of the population they came from: the average change you would see if every possible subject went through the study. The book writes it with a subscript d, for differences.
\[ \mu_d = \text{population mean of the differences} \]
It is a single number, not a difference of two means, and that is why one-sample machinery applies. Its estimate is the sample mean difference, and the random variable is the mean difference of the sensory measurements in a sample of eight.
\[ H_0: \mu_d \ge 0 \qquad H_a: \mu_d < 0 \]
The book reads both in words. The null, zero or positive, means the same or more pain after hypnotism: no improvement. The alternative, negative, means less pain after: improvement. Scores should be lower after, so with after minus before an improvement is a negative difference.
The null holds the equality, as always. The test computes the p-value at the boundary, zero, because that is the null value hardest to reject; if the evidence beats zero it beats every positive value too.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 529 — Example 10.11: the random variable and the hypotheses
Notation
A paired hypothesis carries more meaning than its few symbols show, because half of it lives in the definition of d. Read Example 10.11's pair with that definition attached.
Annotate
On: \( d = \text{after} - \text{before}: \quad H_0: \mu_d \ge 0, \quad H_a: \mu_d < 0 \)
Say each hypothesis aloud in the words of the study, not in symbols: on average, pain is the same or higher after hypnotism; on average, pain is lower after hypnotism. If the spoken version does not match the research question, the symbols are wrong.
The null can be written as an equality, mu sub d equals zero, and many texts do. The test and the p-value are the same either way, because the calculation is done at zero, the boundary between the two hypotheses.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 529 — Example 10.11: H0 and Ha with the book's explanation in words
Notation
Here is the statistic the section uses. Every symbol is one you met in Chapter 9, now carrying a d to say it describes the differences.
Annotate
On: \( t = \frac{\bar{x}_d - \mu_d}{s_d/\sqrt{n}}, \qquad df = n - 1 \)
Read the fraction as a question: how many standard errors is the observed mean change away from no change? With μd equal to zero the top is just the mean difference, so t is the average change measured in standard errors.
The conditions come with it. The differences should come from a normal population, or there should be enough of them that the sample mean of the differences is approximately normal. With four or eight pairs, that means looking at the differences for skew and outliers.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 528 — the test statistic and the sixth characteristic
Concept
Section 10.1's independent test had degrees of freedom near the total of both sample sizes. The paired test has far fewer, and it is worth seeing why that is right rather than a penalty.
\[ \text{independent: } n_1 + n_2 - 2 = 8 + 8 - 2 = 14 \qquad \text{paired: } n - 1 = 8 - 1 = 7 \]
Degrees of freedom count independent pieces of information about spread. In the paired design, the information about spread comes only from how the eight differences scatter around their mean. There are eight differences, and one degree of freedom is used up estimating their mean, leaving seven.
The sixteen raw scores are not sixteen independent pieces of information about the hypnotism effect. A subject's after score is tied to their before score, so the pair carries one piece of information about change, not two.
Seven degrees of freedom give a t curve with heavier tails than fourteen would, so the paired test needs a slightly larger statistic to reject. That is the price of pairing. Part 5 shows what is bought with it: a standard error that is often far smaller, which usually more than pays the price.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 528 — n − 1 degrees of freedom, n the number of differences
Concept
A paired problem gives you two things that together fix the tail: the direction of subtraction and the wording of the claim. Neither one alone is enough.
Figure (svg): Three t curves side by side. Left: only the left tail is shaded, headed alternative less than zero, captioned lower after. Middle: only the right tail is shaded, headed alternative greater than zero, captioned higher after. Right: both tails are shaded, headed alternative not equal to zero, captioned a change either way.
Take the softball coach in Example 10.12. The differences are after minus before, and the claim is that the class makes players stronger, so lifts should be higher after. Higher after, with after first, is a positive difference: the alternative is greater than zero, a right tail.
Example 10.13 has no direction in its claim at all. The students thought they could push equal distances with either hand, so the question is whether the mean difference is anything other than zero. That is two-tailed, and evidence counts in either tail.
A quick way to check yourself: say what a single subject who supports the claim would look like, compute that subject's difference in your chosen order, and look at its sign. The alternative points the same way.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 530-532 — the hypotheses of Examples 10.12 and 10.13
Discrimination
Every study below forms its differences as after minus before. For each one, decide which alternative hypothesis the claim requires. Ask what a subject who supports the claim looks like, and what sign their difference has.
Sort into buckets
Sort each claim by the alternative hypothesis it needs, using after minus before.
Notice that two left-tailed claims are about good outcomes and so are the right-tailed ones. The tail has nothing to do with whether the change is good. It depends only on whether the claim says after is smaller or larger, given that after comes first.
Had the studies used before minus after, every left became a right and every right a left, and the two-tailed claims would not move. That is the whole rule, and it never needs memorising if you do the one-subject check.
Trap
For Example 10.12, a first attempt subtracts before minus after, then writes the claim that the class makes players stronger:
\[ d = \text{before} - \text{after} \]
\[ H_a: \mu_d > 0 \]
Wrong. With before first, a stronger player has a negative difference.
Do the one-subject check. A player who gained, say 205 before and 295 after, has before minus after equal to minus 90. Stronger means negative here, so:
\[ H_a: \mu_d < 0 \]
Or keep the book's order, after minus before, where the same player gives plus 90:
\[ d = \text{after} - \text{before}, \quad H_a: \mu_d > 0 \]
Either is correct. Mixing the two tests for the opposite of the claim: a very strong class would then look like evidence for the null.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 530 — Example 10.12
Matching
Each study states its own direction of subtraction. Match it to the hypotheses that test its claim. Do the one-subject check for each before committing.
Match the pairs
Why: Higher after with after first is positive. A difference between hands with no stated direction is two-tailed. Lower after with before first makes before minus after positive, so that claim is also a right tail. Lower after with after first is negative, a left tail.
For each study, the one-subject check takes one line: picture a participant who supports the claim, write their difference in the study's order, and read its sign. The diet is the one to slow down on. The claim is about lowering, which sounds like a left tail, but this version subtracts before minus after. A subject whose cholesterol fell has a positive difference, so the alternative is greater than zero.
The shot-put study is the only two-tailed one, and it is two-tailed because the students' claim was equality, not a direction. A null of equal hands with no direction claimed leaves both tails as evidence. Two right-hand options read the same in symbols. What separates them is the story: the study's own direction tells you which comparison a positive difference stands for.
Section
Part 4
Concept
With the differences computed and the hypotheses written, there is nothing new left to learn. The book says the population mean of the differences is tested using a Student's t test for a single population mean with n minus one degrees of freedom.
\[ \text{SE} = \frac{s_d}{\sqrt{n}}, \qquad t = \frac{\bar{x}_d - 0}{\text{SE}}, \qquad df = n - 1 \]
Compare it with the warm-up. There, nine values with mean 52 were tested against 48. Here, n differences with mean x-bar sub d are tested against zero. The only thing that marks the test as paired is where its single column of numbers came from.
That is a real simplification. Section 10.1's two-sample test needed two variance terms and a long degrees-of-freedom formula. None of that appears here: one standard deviation, one sample size, and degrees of freedom you can count on your fingers.
Software agrees. On the book's calculators you either type the differences into a list or let the calculator subtract one list from another, and then run the ordinary one-sample T-Test on that list with the hypothesised mean set to zero.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 528-529 — the test for μd, and the calculator note
Worked example
Are the sensory measurements, on average, lower after hypnotism? Test at the 5 percent level. The differences are after minus before, and they are assumed to come from a normal population.
Everything up to the statistic is already done: the hypotheses and the summary values come from the last two parts. The new moves are the standard error, the statistic, the tail area and the sentence that ends it.
\[ H_0: \mu_d \ge 0, \quad H_a: \mu_d < 0, \qquad \bar{x}_d = -3.125, \quad s_d = 2.9114, \quad n = 8 \]
The standard error
Why: the differences' standard deviation over the root of the number of pairs.
\[ \text{SE} = \frac{2.9114}{\sqrt{8}} = \frac{2.9114}{2.8284} = 1.0293 \]
The test statistic
Why: the mean difference in standard errors, measured from zero.
\[ t = \frac{-3.125 - 0}{1.0293} = -3.036 \]
Degrees of freedom
Why: eight differences.
\[ df = 8 - 1 = 7 \]
Read the statistic before looking anything up. The average change sits a little more than three standard errors below zero. Chapter 9's rough benchmarks say that two standard errors is borderline at 5 percent and three is strong, so expect a p-value under one percent.
The p-value
Why: a left tail, because the alternative is less than zero.
\[ p = P(t_7 < -3.036) = 0.0095 \]
Figure (svg): A t curve with 7 degrees of freedom on a horizontal axis from minus 4.5 to 4.5. The region left of minus 3.036 is shaded yellow and labelled p-value 0.0095. A red dashed line at minus 1.895 marks the 5 percent critical value. A yellow dot on the axis marks t equals minus 3.04.
Decide
Why: compare alpha with the p-value.
\[ \alpha = 0.05 > p = 0.0095 \;\Rightarrow\; \text{reject } H_0 \]
Conclusion: at the 5 percent level, from the sample data, there is sufficient evidence to conclude that sensory measurements are, on average, lower after hypnotism. The book adds that rejecting means the population mean difference is below zero; strictly the data are evidence for that, not a proof of it.
Check with the t table
Why: the 0.01 and 0.005 cut-offs for 7 df bracket the statistic, so the p-value must fall between those two areas; the exact 0.00948 does. The book's calculator box prints 0.0094 and its text 0.0095; 0.0095 is the correct rounding.
\[ 2.998 < |t| = 3.036 < 3.499 \;\Rightarrow\; 0.005 < p < 0.01 \]
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 529 — Example 10.11 and Figure 10.10
Concept
The book's sixth characteristic is the condition the t procedure needs: either the differences come from a normal population, or there are enough of them that the sample mean of the differences is approximately normal anyway.
Notice what is not required. The before scores need not be normal, nor the after scores; only the differences matter, because they are the only data the test sees. A skewed before column can still give well-behaved differences.
Figure (svg): Three dot rows on one scale from minus 30 to 40. Cholesterol differences: nine blue dots from minus 27 to 11. Shot-put differences: seven yellow dots from minus 1 to 12. Throwing differences: five orange dots from 2 to 37. Each row has a yellow dashed line at its mean. No row has a value far from the others.
With five to nine differences, the most you can do is look. A dot plot like this one should show no lone value far from the rest and no strong lean to one side. All three of these pass that rough test; the lifting data, with its 90-pound gain, did not.
The book's examples simply state that the differences have a normal distribution. In practice you would say how you checked, and with very small samples you would admit that the check is weak and the p-value approximate.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 528 — the sixth characteristic: normal differences, or enough of them
Picture it
A t statistic of minus 3.04 is abstract. Here is the same test drawn in the units of the problem: the curve shows where the mean difference of eight subjects would land, over and over, if hypnotism had no effect at all.
Figure (svg): A bell-shaped curve centred at 0 for the sample mean difference under the null hypothesis, with horizontal axis in sensory points from minus 5 to 5. Its spread is set by the standard error 1.029. The area left of minus 3.125 is shaded yellow. A yellow dot marks the observed mean difference, minus 3.125, about three standard errors below zero.
Under the null hypothesis the curve is centred at zero change, and its spread is the standard error, 1.029 points. Eight-subject averages would usually fall within a point or two of zero. The study's average, minus 3.125, is about three of those standard errors out.
The shaded sliver is the p-value: the proportion of eight-subject studies that would show a drop at least this big from chance alone. It is under one percent, which is what rejecting the null at five percent rests on.
Seeing it in points also keeps the size of the effect in view. A drop of about three points on this pain scale is the estimate; the p-value says it is unlikely to be luck, not that it is large.
Concept
Every test in this section ends with the same kind of sentence, and the book gives it as a template in its Try Its. Fill in each part from the problem, never from memory.
\[ \text{At the } \alpha \text{ level, from the sample data, there } \textbf{is / is not} \]
\[ \text{sufficient evidence to conclude that } \ldots \]
The level is the significance level you were given, not the p-value. The choice between is and is not comes from the decision: is when you reject the null, is not when you do not. The ending is the alternative hypothesis written in words, about the population, in the problem's own terms.
For Example 10.11 the ending is that the sensory measurements, on average, are lower after hypnotism. Notice three things it does. It talks about measurements on average, which is the mean difference. It names the direction of the alternative. And it is about all such subjects, not just these eight.
Two endings to avoid. A conclusion that stops at reject the null tells the reader nothing about pain. And a not-sufficient conclusion must never be turned round into a claim that there is no difference, which is a trap you will meet in this part.
When you can, add the estimate: a mean drop of about 3.1 points. The test says whether there is an effect; the estimate says how big it is, and a reader needs both.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 529 — Example 10.11's conclusion; the template is the book's Try It 10.10(h)
Worked example
Some courses and exams ask for the decision by comparing the statistic with a critical value from a t table, instead of finding a p-value. Run Example 10.11 that way; it must reach the same decision.
The rejection region is set before looking at the data: for a left-tailed test at 5 percent, it is the 5 percent of the t curve furthest to the left. Then you ask whether the observed statistic lands in it.
Read the critical value
Why: left tail, area 0.05, 7 degrees of freedom; the table gives the positive value, so attach the minus sign.
\[ t^{*} = -t_{0.05,\,7} = -1.895 \]
The critical value depends only on the significance level, the tail and the degrees of freedom. It is the same for every study with eight pairs tested at 5 percent on the left, whatever the data turn out to be.
State the rejection region
Why: values of t at or below the critical value.
\[ \text{reject } H_0 \text{ if } t \le -1.895 \]
Bring in the statistic
Why: computed on the previous slides.
\[ t = -3.036 \]
Compare
Why: minus 3.036 is further left than minus 1.895.
\[ -3.036 < -1.895 \;\Rightarrow\; \text{reject } H_0 \]
In context: the same conclusion as before, sufficient evidence at the 5 percent level that mean sensory scores are lower after hypnotism. The critical-value method gives the decision but hides how strong the evidence is; the p-value of 0.0095 says it would also pass at the 1 percent level.
Check the two methods agree
Why: the statistic is beyond the cut-off exactly when its tail area is below alpha.
\[ P(t_7 < -1.895) = 0.05, \qquad P(t_7 < -3.036) = 0.0095 < 0.05 \]
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 529 — Example 10.11 and Figure 10.10
Worked example
The book stops at the test, but the same differences give a confidence interval, with Chapter 8's method for one mean. This is an addition to the section: a 95 percent interval for the population mean change in pain score.
The interval answers a different question from the test: not whether the change is zero, but which values of the mean change are plausible. It uses the same standard error, with a two-sided t multiplier.
The t multiplier
Why: 95 percent, two-sided, 7 degrees of freedom.
\[ t_{0.025,\,7} = 2.365 \]
The margin of error
Why: multiplier times standard error.
\[ EBM = 2.365 \times 1.0293 = 2.434 \]
The lower bound
Why: mean difference minus the margin.
\[ -3.125 - 2.434 = -5.559 \]
The upper bound
Why: mean difference plus the margin.
\[ -3.125 + 2.434 = -0.691 \]
Figure (svg): A number line from minus 7 to 1 in sensory points. A thick blue interval runs from -5.56 to -0.69, with a yellow dot at the sample mean difference, minus 3.125. A dashed line at zero, labelled no change, lies to the right of the whole interval.
In context: with 95 percent confidence, the population mean change in sensory score after hypnotism is between a drop of 5.56 points and a drop of 0.69 points. The interval is wide, because eight subjects cannot pin the mean down closely.
Check against the test
Why: zero lies outside the interval, which agrees with rejecting a mean change of zero; the interval's midpoint is the sample mean.
\[ \frac{-5.559 + (-0.691)}{2} = -3.125, \qquad 0 > -0.691 \]
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §8.2, recalled; §10.4, p. 529 — the t interval for one mean, on Example 10.11's differences
Estimation
Try It 10.11's nine differences have mean -10.78 and standard deviation 11.86. Before computing, estimate the t statistic using a rough square root.
Predict first
Roughly what is the t statistic for the cholesterol differences?
Correct: About minus 2.7
Why: The standard error is about 11.9 over 3, roughly 4, and minus 10.8 divided by 4 is about minus 2.7. Dividing by the standard deviation instead of the standard error gives about minus 0.9; forgetting the square root gives about minus 8.
\[ \frac{s_d}{\sqrt{n}} = \frac{11.86}{3} \approx 3.95, \qquad t \approx \frac{-10.78}{3.95} \approx -2.7 \]
Estimating first is worth the ten seconds it takes: if your careful calculation later gives minus 0.9 or minus 8, you will know at once that something went wrong, and roughly what. Nine pairs is convenient because the square root is exactly three, so the estimate is easy. The two wrong answers are the classic slips with this statistic: forgetting to divide by the root of n, and dividing by n instead of its root.
The estimate also tells you what kind of p-value to expect. A statistic of nearly three standard errors with eight degrees of freedom should give a left tail of one or two percent.
Worked example
Nine randomly selected subjects followed a new diet. The differences, after minus before, are assumed normal. Are cholesterol levels lower on average after the diet? Test at the 5 percent level.
Lower after, with after first, is a negative difference, so this is a left-tailed test like the hypnotism study. With integer data the shortcut for the sum of squares avoids nine messy deviations.
\[ d: -10, -3, -16, 11, 1, -15, -27, -17, -21 \qquad H_0: \mu_d \ge 0, \; H_a: \mu_d < 0 \]
Mean difference
Why: the total from the fill-in slide over nine.
\[ \bar{x}_d = \frac{-97}{9} = -10.7778 \]
Sum of squares
Why: square each difference and add.
\[ \Sigma d^2 = 100 + 9 + 256 + 121 + 1 + 225 + 729 + 289 + 441 = 2171 \]
Square the signed differences, so that the plus 11 and minus 11 both give 121. Then the shortcut subtracts the square of the total over n, which removes the part of the sum of squares that is due to the mean rather than to the spread.
Sum of squared deviations
Why: the shortcut from Example 10.11's check.
\[ 2171 - \frac{(-97)^2}{9} = 2171 - 1045.444 = 1125.556 \]
Standard deviation
Why: divide by 8, then take the root.
\[ s_d = \sqrt{\frac{1125.556}{8}} = \sqrt{140.694} = 11.8615 \]
Standard error and t
Why: over the root of 9, which is 3.
\[ t = \frac{-10.7778}{11.8615/3} = \frac{-10.7778}{3.9538} = -2.726 \]
p-value and decision
Why: left tail on 8 df, against alpha.
\[ p = P(t_8 < -2.726) = 0.0130 < 0.05 \;\Rightarrow\; \text{reject } H_0 \]
Figure (svg): A t curve with 8 degrees of freedom. The region left of minus 2.726 is shaded yellow and labelled p-value 0.0130. A red dashed line at minus 1.860 marks the 5 percent cut-off.
Conclusion: at the 5 percent level there is sufficient evidence that subjects' cholesterol is lower, on average, after the diet; the sample's mean drop is about 10.8 units. The book prints no answer for this Try It; these values are computed from its data.
Check with the t table
Why: the one-tailed 0.025 and 0.01 cut-offs for 8 df bracket the statistic.
\[ 2.306 < 2.726 < 2.896 \;\Rightarrow\; 0.01 < p < 0.025 \]
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 530 — Try It 10.11 and Table 10.16
Worked example
Four softball players' maximum lifts were recorded before and after a strength development class. The coach wants to know whether the class makes players stronger, on average. Use after minus before, assume the differences are normal, and test at 5 percent.
| player | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| before (lb) | 205 | 241 | 338 | 368 |
| after (lb) | 295 | 252 | 330 | 360 |
The differences
Why: after minus before, each player.
\[ 295 - 205 = 90, \; 252 - 241 = 11, \; 330 - 338 = -8, \; 360 - 368 = -8 \]
Hypotheses
Why: stronger after, with after first, is positive: a right tail.
\[ H_0: \mu_d \le 0, \qquad H_a: \mu_d > 0 \]
Mean
Why: the total over four.
\[ \bar{x}_d = \frac{90 + 11 - 8 - 8}{4} = \frac{85}{4} = 21.25 \]
Look at the four differences before going further. Two players lifted 8 pounds less after the class, one gained 11, and one gained 90. The mean of 21.25 describes none of them; it is pulled up by the single large gain, which the book flags as a possible outlier.
Sum of squared deviations
Why: by the shortcut.
\[ (8100 + 121 + 64 + 64) - \frac{85^2}{4} = 8349 - 1806.25 = 6542.75 \]
Standard deviation
Why: divide by 3 and take the root.
\[ s_d = \sqrt{\frac{6542.75}{3}} = \sqrt{2180.92} = 46.70 \]
Statistic
Why: standard error is s over the root of 4, which is 2.
\[ t = \frac{21.25}{46.70/2} = \frac{21.25}{23.350} = 0.910 \]
p-value and decision
Why: right tail on 3 df.
\[ p = P(t_3 > 0.910) = 0.2149 > 0.05 \;\Rightarrow\; \text{do not reject } H_0 \]
Figure (svg): A t curve with 3 degrees of freedom, axis from minus 5 to 5. The region right of t equals 0.910 is shaded yellow and labelled p-value 0.2149. A red dashed line at 2.353 marks the 5 percent cut-off, well to the right of the observed t.
Conclusion: at the 5 percent level there is not sufficient evidence that the class made the players stronger on average. The book prints p as 0.2150; the exact value is 0.21494, so 0.2149 is the correct rounding, and the decision is the same.
Check with the t table
Why: the 0.25 and 0.20 one-tailed cut-offs for 3 df bracket the statistic.
\[ 0.765 < 0.910 < 0.978 \;\Rightarrow\; 0.20 < p < 0.25 \]
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 530-531 — Example 10.12, Table 10.17 and Figure 10.11
Counterexample
The book adds a warning to Example 10.12: the differences look right-skewed, and the 90 may be an extreme outlier. It is pulling the mean up to 21.3, while the other three differences average a negative number. Here are the four differences on one line.
Figure (svg): A number line from minus 20 to 100 pounds with the four lift differences: two dots stacked at minus 8, one at 11, and one red dot far out at 90 labelled possible outlier. A yellow dashed line marks the mean of all four, 21.25, and a pink dashed line marks the mean of the other three, minus 1.67. A grey dashed line marks zero.
Discussion prompt
Recompute the mean of the lift differences without the 90-pound gain. What does the comparison say about the normality condition, and about how much four players can tell the coach?
This is the book's own advice: confirm that the differences plausibly come from a normal population, and consider a larger sample. A failure to reject here says the study was too small and too noisy to show anything, not that the class does nothing.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 530-531 — the note on Example 10.12 and the closing remark
Worked example
Four students took a practice SAT before a new prep class and another after it. Are scores, on average, higher after the class? Test at the 5 percent level, with after minus before, assuming normal differences.
| student | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| before | 1840 | 1960 | 1920 | 2150 |
| after | 1920 | 2160 | 2200 | 2100 |
The differences
Why: after minus before.
\[ 80, \quad 200, \quad 280, \quad -50 \]
Three students gained between 80 and 280 points and one lost 50. Gains this large look impressive, but they are also very uneven, and with four students the unevenness will weigh heavily in the standard deviation.
Hypotheses
Why: higher after is positive: a right tail.
\[ H_0: \mu_d \le 0, \qquad H_a: \mu_d > 0 \]
Mean
Why: total 510 over four.
\[ \bar{x}_d = \frac{510}{4} = 127.5 \]
Sum of squares
Why: square each difference.
\[ \Sigma d^2 = 6400 + 40000 + 78400 + 2500 = 127300 \]
Sum of squared deviations
Why: the shortcut.
\[ 127300 - \frac{510^2}{4} = 127300 - 65025 = 62275 \]
Standard deviation
Why: over 3, then the root.
\[ s_d = \sqrt{\frac{62275}{3}} = 144.08 \]
Statistic
Why: standard error is s over 2.
\[ t = \frac{127.5}{144.08/2} = \frac{127.5}{72.04} = 1.770 \]
p-value and decision
Why: right tail on 3 df.
\[ p = P(t_3 > 1.770) = 0.0874 > 0.05 \;\Rightarrow\; \text{do not reject } H_0 \]
Figure (svg): A t curve with 3 degrees of freedom. The region right of t equals 1.770 is shaded yellow and labelled p-value 0.0874. A red dashed line at 2.353 marks the 5 percent cut-off, to the right of the observed t.
Conclusion: at the 5 percent level there is not sufficient evidence that scores are higher on average after the class, even though the average gain was 127.5 points. Student 4's drop of 50 and the spread of the gains leave too much doubt with only four students.
Check with the t table
Why: the 0.10 and 0.05 one-tailed cut-offs for 3 df bracket the statistic.
\[ 1.638 < 1.770 < 2.353 \;\Rightarrow\; 0.05 < p < 0.10 \]
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 531 — Try It 10.12 and Table 10.18
Worked example
Seven eighth graders pushed the shot-put with their dominant and their weaker hand. They thought the distances would be equal. Test whether the mean difference is significant, using dominant minus weaker, at the 5 percent level.
The differences
Why: dominant minus weaker, each student.
\[ 30 - 28 = 2, \quad 26 - 14 = 12, \quad 34 - 27 = 7, \quad 17 - 18 = -1 \]
\[ 19 - 17 = 2, \quad 26 - 26 = 0, \quad 20 - 16 = 4 \]
Hypotheses
Why: equal distances is the null; no direction is claimed.
\[ H_0: \mu_d = 0, \qquad H_a: \mu_d \ne 0 \]
Mean
Why: total 26 over seven.
\[ \bar{x}_d = \frac{26}{7} = 3.7143 \]
Sum of squares
Why: square each difference; the zero adds nothing.
\[ \Sigma d^2 = 4 + 144 + 49 + 1 + 4 + 0 + 16 = 218 \]
Sum of squared deviations
Why: the shortcut.
\[ 218 - \frac{26^2}{7} = 218 - 96.571 = 121.429 \]
Standard deviation
Why: over 6, then the root.
\[ s_d = \sqrt{\frac{121.429}{6}} = \sqrt{20.238} = 4.4987 \]
Statistic
Why: standard error over the root of 7.
\[ t = \frac{3.7143}{4.4987/\sqrt{7}} = \frac{3.7143}{1.7003} = 2.184 \]
p-value
Why: two-tailed: double the tail beyond the statistic.
\[ p = 2P(t_6 > 2.184) = 2(0.0358) = 0.0716 \]
The doubling is the step that is easiest to forget. The alternative says the hands differ in either direction, so a statistic as extreme as 2.18 in the negative direction would count just as much. The tail on each side holds about 0.036, and together they make 0.0716.
Figure (svg): A t curve with 6 degrees of freedom. Both tails beyond minus 2.184 and 2.184 are shaded yellow, together labelled p-value 0.0716. Red dashed lines at minus 2.447 and 2.447 mark the two-tailed 5 percent cut-offs, each outside the shaded boundary.
Decide
Why: alpha is smaller than p.
\[ \alpha = 0.05 < p = 0.0716 \;\Rightarrow\; \text{do not reject } H_0 \]
Conclusion: at the 5 percent level there is not sufficient evidence of a difference between the children's dominant and weaker hands in pushing the shot-put. The book's rounded values, 3.71 and 4.5, give t of 2.18 and p of 0.0719; the data themselves give 0.0716.
Check with the t table
Why: the two-tailed 0.10 and 0.05 cut-offs for 6 df bracket the statistic.
\[ 1.943 < 2.184 < 2.447 \;\Rightarrow\; 0.05 < p < 0.10 \]
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 531-532 — Example 10.13, Table 10.19 and Figure 10.12
Socratic
Student 6 in Example 10.13 pushed the shot-put 26 feet with each hand, a difference of exactly zero. It is tempting to think that student tells you nothing about which hand is stronger and could be left out.
Discussion prompt
Should student 6, whose difference is zero, be dropped from the paired t test? What would dropping that student do to the mean, the standard deviation and the degrees of freedom?
The temptation comes from a different procedure, the sign test, which counts only which way each pair moved and so has no use for ties. The t test works with the sizes of the differences, and a size of zero is information like any other.
The general rule is worth stating: never drop a value because it is inconvenient for the question. If a value is an error, correct it; if it is real, it stays.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 531-532 — Example 10.13: the differences include a 0
Worked example
Five ball players think they can throw the same distance with their dominant (throwing) hand and their off-hand (catching hand). Test whether the mean difference is significant at the 5 percent level, using dominant minus off-hand.
| player | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| dominant | 120 | 111 | 135 | 140 | 125 |
| off-hand | 105 | 109 | 98 | 111 | 99 |
The differences
Why: dominant minus off-hand.
\[ 15, \quad 2, \quad 37, \quad 29, \quad 26 \]
Every player threw farther with the dominant hand, by between 2 and 37 units. All five differences share a sign, which already suggests strong evidence, but they are spread widely, so the standard deviation will be large too.
Hypotheses
Why: the same distance is the null; no direction claimed.
\[ H_0: \mu_d = 0, \qquad H_a: \mu_d \ne 0 \]
Mean
Why: total 109 over five.
\[ \bar{x}_d = \frac{109}{5} = 21.8 \]
Sum of squares
Why: square each difference.
\[ \Sigma d^2 = 225 + 4 + 1369 + 841 + 676 = 3115 \]
Sum of squared deviations
Why: the shortcut.
\[ 3115 - \frac{109^2}{5} = 3115 - 2376.2 = 738.8 \]
Standard deviation
Why: over 4, then the root.
\[ s_d = \sqrt{\frac{738.8}{4}} = \sqrt{184.7} = 13.590 \]
Statistic
Why: standard error over the root of 5.
\[ t = \frac{21.8}{13.590/\sqrt{5}} = \frac{21.8}{6.078} = 3.587 \]
p-value and decision
Why: two tails on 4 df.
\[ p = 2P(t_4 > 3.587) = 0.0230 < 0.05 \;\Rightarrow\; \text{reject } H_0 \]
Figure (svg): A t curve with 4 degrees of freedom, axis from minus 5 to 5. Both tails beyond minus 3.587 and 3.587 are shaded yellow, together p-value 0.0230. Red dashed lines at minus 2.776 and 2.776 mark the 5 percent cut-offs, inside the observed values.
Conclusion: at the 5 percent level there is sufficient evidence that the mean throwing distance differs between the dominant hand and the off-hand; in this sample the dominant hand threw about 22 units farther on average. The book prints no answer; these values come from its data.
Check with the t table
Why: the two-tailed 0.05 and 0.02 cut-offs for 4 df bracket the statistic.
\[ 2.776 < 3.587 < 3.747 \;\Rightarrow\; 0.02 < p < 0.05 \]
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 532 — Try It 10.13 and Table 10.20
Fill the middle
Suppose the hypnotism researchers had asked only whether hypnotism changes the measurements, in either direction. The statistic is the same, minus 3.036 on 7 degrees of freedom. Fill in the hypotheses and the new p-value.
Fill in the blanks
H_a: \mu_d \ne 0, \qquad p = 2 \times 0.0095 = 0.019
Why: A change in either direction is the alternative not equal to zero, and the p-value counts both tails: twice the one-tailed area, about 0.019. That is still below 0.05, so the decision at 5 percent does not change, but it would at the 1 percent level.
\[ p = 2P(t_7 < -3.036) = 0.0190 \]
The one-tailed test was right for this study, because the researchers predicted less pain before they collected data. Choosing the tail after seeing which way the data went would be cheating: it halves the p-value for free.
At the 1 percent level the two versions disagree: 0.0095 rejects and 0.019 does not. A study with a genuine directional claim earns that extra power by stating its direction in advance.
Trap
After Example 10.13's p-value of 0.0716, a first attempt concludes:
\[ p = 0.0716 > 0.05 \]
so the students push equal distances with either hand.
Wrong. Not rejecting is not accepting.
The test found insufficient evidence of a difference, from seven students. The sample's dominant hand was 3.7 feet farther on average:
\[ \bar{x}_d = 3.71 \text{ feet} \]
Five of seven students threw farther with their dominant hand. A real difference of a few feet is entirely consistent with these data; seven students were too few to establish it.
Say: not sufficient evidence of a difference. Never: the hands are equal.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 532 — Example 10.13's conclusion
Tweak it
With the mean difference and its standard deviation held fixed, the paired statistic grows with the square root of the number of pairs. The slider shows how fast.
Parameter explorer
The curve is t plotted against the number of pairs n, for a fixed mean difference and standard deviation. Set them to Example 10.13's 3.7 and 4.5. Roughly how many students would the shot-put study have needed for t to pass about 2.1, the two-tailed cut-off for a larger sample?
\[ t = \frac{{m}\sqrt{n}}{{s}} \]
What to notice: the same average change can be insignificant with seven pairs and convincing with twenty. The p-value measures evidence, and evidence grows with the number of pairs, while the size of the change stays where it was.
Now move the standard deviation. Halving it doubles t at every n. That is the lever pairing pulls: it does not change the mean difference, but by removing the variation between subjects it shrinks the standard deviation the statistic divides by.
Section
Part 5
Intuition
People differ. Some feel more pain than others, some students are stronger, some start with higher cholesterol. In an independent-samples study all of that variation lands in the standard error and hides the effect you are looking for.
Figure (svg): Three dot rows on one scale from minus 5 to 40 feet. Dominant hand: seven orange dots from 17 to 34. Weaker hand: seven blue dots from 14 to 28. Differences: seven yellow dots from minus 1 to 12. The raw rows each spread over about 15 to 17 feet; the differences spread over 13 feet but bunch between 0 and 7, with standard deviation 4.50 against 6.21 and 5.90 for the columns.
Example 10.13's two raw columns each spread over about fifteen feet, with standard deviations 6.21 and 5.90, and they overlap almost completely. Look at the differences instead: they bunch between minus 1 and 7, with one 12, and their standard deviation is 4.50.
Subtracting within a student removes everything about that student that affects both throws equally: their size, their training, their technique. What remains is only how much better their dominant hand is, which is the one thing the question is about.
That is what the phrase own control means. Each subject's weaker hand is the comparison for their dominant hand, and nobody is compared with anybody else. The variation between subjects is cancelled rather than averaged.
Picture it
A test statistic is an observed gap divided by a yardstick, the standard error. Pairing does not change the gap at all; it changes the yardstick. Here is Example 10.13's gap of 3.71 feet held against both.
Figure (svg): Two bell-shaped curves, one above the other, on the same horizontal scale from minus 12 to 12 feet. Top: the null distribution of the gap if the hands were analysed as independent samples, wide, with standard error 3.24. Bottom: the null distribution of the mean difference in the paired analysis, narrow, with standard error 1.70. The observed gap, 3.71 feet, is marked on both, and the two-sided tails beyond it are shaded: large on the top curve, small on the bottom.
On top, the yardstick of the independent formula: a standard error of 3.24 feet, because it counts every difference in strength between students as noise. Against that wide curve, a gap of 3.71 feet is barely more than one standard error, and more than a quarter of the curve lies further out.
Below, the paired yardstick: 1.70 feet, built only from how much each student's two hands differ from the typical gap. The same 3.71 is now more than two standard errors out, and the shaded tails shrink to about 7 percent.
The gap is a fact about the data; the yardstick is a fact about the design. Choosing the right yardstick is not a way to manufacture significance. It is measuring the hands' difference against the variation that could actually disguise it.
Concept
This slide goes a little beyond the book, to make the advantage exact. The variance of a difference of two linked measurements is the sum of their variances minus a term for how much they move together, where r is their correlation.
\[ s_d^2 = s_1^2 + s_2^2 - 2r\,s_1 s_2 \]
For Example 10.13 put in the two hands' standard deviations and the correlation of 0.725:
\[ s_d^2 = 6.214^2 + 5.900^2 - 2(0.725)(6.214)(5.900) \]
\[ = 38.619 + 34.810 - 53.190 = 20.238 \]
Figure (svg): Five horizontal bars drawn to one scale. The dominant hand's variance, 38.62, and the weaker hand's, 34.81, add to 73.43. A red bar of length 53.19, twice the correlation times the two standard deviations, is cut off the end. What remains, 20.24, is the variance of the differences.
That is exactly the 20.238 you get from the differences directly. With r equal to zero the last term vanishes and the variances simply add, which is what the independent formula assumes. The more positive r is, the more is subtracted.
So pairing pays most when subjects differ a lot from one another and each subject's two measurements track each other closely. That is the design rule in one sentence.
Comparison
Here are four of the section's data sets, each analysed correctly as paired and, for comparison only, as if independent. Fill in the blanks from the numbers on earlier slides, then read the pattern down the columns.
Comparison matrix
| data set | correlation r | paired SE | independent SE | pairing helped? |
|---|---|---|---|---|
| hypnotism (10.11) | 0.27 | 1.029 | 1.201 | a little |
| cholesterol (TI 10.11) | 0.57 | 3.954 | 5.816 | yes |
| shot-put (10.13) | 0.73 | 1.70 | 3.239 | yes, a lot |
| throwing (TI 10.13) | -0.12 | 6.078 | 5.805 | no |
Read the correlation column against the last one. The shot-put pairs, with r of 0.73, cut the standard error almost in half. The cholesterol pairs, r of 0.57, cut it by a third. The hypnotism pairs, r of 0.27, barely help.
The throwing data have a slightly negative correlation, and there the paired standard error is larger than the independent one. Players with a strong throwing arm in this sample did not have a strong catching arm, so there was nothing shared to cancel.
Put the pattern as a rule of thumb: the correlation between the two measurements is the share of their variation that pairing can remove. High correlation, big saving; zero correlation, no saving, and fewer degrees of freedom. This table is about design, not about choosing a test after the fact. Data collected in pairs must be analysed as pairs, whatever the correlation turns out to be.
Counterexample
Pairing is not automatically better. Try It 10.13's throwing data are the book's own example of a case where it bought nothing.
Discussion prompt
For the five ball players, the paired analysis gives p of 0.023 on 4 degrees of freedom; treating the columns as independent (wrongly) gives p of about 0.010. Why did pairing not help here, and what did it cost?
The lesson for designing a study: pair when you expect the two measurements on a subject to move together, which is most before-and-after studies and most matched designs. The lesson for analysing one is unchanged: the design you ran decides the test you use.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 532 — Try It 10.13 and Table 10.20
Edge cases
The identity on the earlier slide says the standard deviation of the differences depends on the correlation. Here it is as a curve, with the correlation along the horizontal axis.
Parameter explorer
The curve is the standard deviation of the differences against the correlation r, for two columns with standard deviations a and b. Set a and b to the shot-put's 6.2 and 5.9. What is the curve's value at r equal to 0, at r equal to 0.73, and at r equal to 1?
\[ s_d = \sqrt{a^2 + b^2 - 2r\,ab}, \quad a = {a}, \; b = {b} \]
What to notice: the curve only ever falls as r rises, and it falls fastest near r of one. Moderate correlations already give large savings, and very high ones give enormous savings.
Negative correlation is the boundary case pairing cannot help with. It is rare in a sensible paired design, because the whole reason to pair is that the two measurements share something, but the throwing data show it can happen in a small sample.
Real world
Paired designs are everywhere once you look: crossover drug trials, taste tests where each judge tries both recipes, tyre tests with one of each brand on every car, twin studies. Try designing one.
Discussion prompt
A school wants to know whether a new reading app improves reading speed. Describe an independent-samples design and a paired design for the question, and say what source of variation the paired design removes.
Notice the trade in the last answer. A before-and-after design removes variation between subjects but has no control for everything else that changes over time. A matched design with random assignment keeps both advantages, at the price of finding good matches.
OpenStax Introductory Business Statistics 2e, §10.6 Matched or Paired Samples §10.6 Matched or Paired Samples — the same design in business settings
Worked example
This example is made up, to show the matched kind of pairing. Six pairs of twins each have one twin taught to read by method A and the other by method B, with a coin toss deciding which. Is there a difference in mean reading score between the methods? Test at 5 percent, with A minus B.
Figure (svg): Six rows, one per pair of twins, on a reading-score scale from 60 to 95. In each row an orange dot marks the method A twin and a blue dot the method B twin, joined by a yellow segment labelled with the difference A minus B: plus 4, plus 5, minus 1, plus 6, plus 3, plus 5. The pairs sit at very different heights of the scale, from about 70 to 91.
The twins are different children, but each pair shares a home, a school and much of its ability, so the two scores in a pair are linked. That makes the design paired, and the coin toss within each pair is what lets a difference be credited to the method.
The differences
Why: method A minus method B, each pair.
\[ 78 - 74 = 4, \quad 85 - 80 = 5, \quad 69 - 70 = -1 \]
\[ 91 - 85 = 6, \quad 74 - 71 = 3, \quad 82 - 77 = 5 \]
Hypotheses
Why: a difference in either direction.
\[ H_0: \mu_d = 0, \qquad H_a: \mu_d \ne 0 \]
Mean
Why: total 22 over six.
\[ \bar{x}_d = \frac{22}{6} = 3.6667 \]
Sum of squares
Why: square each difference.
\[ \Sigma d^2 = 16 + 25 + 1 + 36 + 9 + 25 = 112 \]
Sum of squared deviations
Why: the shortcut.
\[ 112 - \frac{22^2}{6} = 112 - 80.667 = 31.333 \]
Standard deviation
Why: over 5, then the root.
\[ s_d = \sqrt{\frac{31.333}{5}} = \sqrt{6.2667} = 2.5033 \]
Statistic
Why: standard error over the root of 6.
\[ t = \frac{3.6667}{2.5033/\sqrt{6}} = \frac{3.6667}{1.0220} = 3.588 \]
p-value and decision
Why: two tails on 5 df.
\[ p = 2P(t_5 > 3.588) = 0.0157 < 0.05 \;\Rightarrow\; \text{reject } H_0 \]
In context: at the 5 percent level there is sufficient evidence that mean reading scores differ between the methods, with method A ahead by about 3.67 points in these pairs. Had the twelve children been treated as two independent groups, the p-value would have been 0.38, because ability varies so much between families.
Check against the column means
Why: the mean difference equals the difference of the two methods' means.
\[ \bar{x}_A - \bar{x}_B = 79.8333 - 76.1667 = 3.6667 \]
Trap
After Example 10.11's rejection, a first attempt concludes:
\[ p = 0.0095 < 0.05 \]
so hypnotism caused the drop in pain.
Too strong. The test shows the drop is unlikely to be chance, not what caused it.
The design has no control group. Pain might have fallen anyway: from rest, from expecting relief, or because people first measured on a bad day drift back towards normal.
\[ \text{evidence: } \mu_d < 0 \]
A causal claim needs a comparison: a second matched group that gets a sham session, with treatment assigned at random. The book's phrase, hypnotism appears to be effective, is about as far as these data go.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, p. 529 — Example 10.11's conclusion
Section
Part 6
Pattern
Every example in this section ran through the same sequence. The arithmetic is Chapter 9's; the decisions are what this section adds, and they come first.
Figure (svg): A flow diagram in five boxes joined by arrows. One: is each observation linked to a partner? If no, use an independent-samples test from 10.1 to 10.3. If yes: two, subtract in one fixed direction for every pair. Three, write the hypotheses about mu d, reading the claim through that direction. Four, compute the mean and standard deviation of the differences and t equals the mean over s over root n, with n minus 1 degrees of freedom. Five, find the p-value, decide, and conclude in context.
\[ d_i = x_{1i} - x_{2i}, \quad t = \frac{\bar{x}_d - 0}{s_d/\sqrt{n}}, \quad df = n - 1 \]
Most wrong answers here are correct calculations on the wrong setup: two independent columns where there were pairs, a tail that contradicts the subtraction, or fourteen measurements counted instead of seven pairs. Each has its check, and the list puts each check where it belongs.
Ranking
The steps below are those of Example 10.11, shuffled. Put them in the order you would actually do them. Two of them are decisions you make before looking at any number.
Put in order
Order the steps of a paired t test from first to last.
Why: Recognise the design first, then fix the subtraction, because the hypotheses depend on its direction. Only then summarise, compute the statistic and decide. Writing the hypotheses before computing the mean keeps the data from choosing the tail.
If you placed the hypotheses after computing the statistic, think about why that is risky: once you have seen that the mean difference is negative, a left-tailed alternative looks natural, and a test whose tail was chosen by the data reports half the p-value it should. The order of the second and third steps matters more than it looks. The hypotheses have to be written with the direction of subtraction in hand, but before you have seen the sign of the mean difference, so that the data cannot steer the choice of tail.
Strictly the hypotheses come first of all, from the research question, before any data are collected. Writing them after the subtraction is fine as long as you have not looked at the result.
Check
The first check is about the decision that comes before any arithmetic. Look for the partner structure, not the sample sizes: equal sizes can occur in either design, but only a paired design gives every value one particular partner.
Ask of each study whether a value in one sample has one particular partner in the other, and how many differences the test would use.
Check your understanding
A researcher measures resting heart rate for 12 office workers before and after a six-week walking programme. Which analysis is appropriate?
Answer: A
Why: Each worker is measured twice, so the before and after values are linked worker by worker. Subtract within each worker to get 12 differences, and run a one-sample t on them with 12 minus 1, which is 11, degrees of freedom.
In context: the 12 differences, after minus before, carry everything the test needs, and a negative mean would indicate lower resting heart rate after the programme.
The count is the giveaway in the distractors. Whenever a problem gives twice as many measurements as subjects, the test runs on the number of subjects.
Check
This check is about the step where the most marks are lost: matching the tail to the order of subtraction. Do the one-subject check before choosing, even if the answer seems obvious from the wording.
Picture one participant who supports the claim and compute their difference in the stated order.
Check your understanding
A study of a new mattress records each person's hours of sleep on their old mattress and on the new one, and forms d = old − new. The claim is that people sleep more on the new mattress. Which alternative hypothesis tests the claim?
Answer: A
Why: Someone who sleeps more on the new mattress has new larger than old, so old minus new is negative. The claim therefore says the mean difference is below zero, a left-tailed alternative.
The claim sounds like a greater-than, because it says more. The subtraction turns it round. That is precisely the setting where the one-subject check earns its keep.
In context: rejecting the null here would be evidence that the population mean sleep on the new mattress is greater than on the old.
Check
The last check is pure mechanics, but the distractors are the slips people actually make. Find the standard error first, then the statistic, and count the degrees of freedom from the pairs.
Remember that n counts differences and that the standard error divides by its square root.
Check your understanding
Sixteen pairs give a mean difference of 2.4 and a standard deviation of differences of 4.0. What are the paired t statistic and its degrees of freedom?
Answer: A
Why: The standard error is 4.0 over the square root of 16, which is 4.0 over 4, or 1.0. The statistic is 2.4 divided by 1.0, which is 2.4, and the degrees of freedom are 16 minus 1, which is 15.
\[ \text{SE} = \frac{4.0}{\sqrt{16}} = 1.0, \qquad t = \frac{2.4}{1.0} = 2.4, \qquad df = 15 \]
In context: the mean change sits 2.4 standard errors above zero. For a two-tailed test on 15 degrees of freedom the cut-off is about 2.13, so this would be significant at the 5 percent level.
Explain it to yourself
The idea that pairing removes variation came up in every part of this deck. Explaining it in your own words is the best test of whether it has landed.
Discussion prompt
Using Example 10.13, explain in two or three sentences why the paired analysis gave a much smaller standard error than treating the two hands as independent samples would have, and why that is legitimate rather than a trick.
A strong answer names the correlation between the two hands and says what cancels in the subtraction. A very strong one adds the cost: the paired test has fewer degrees of freedom, so the saving is only worth it when the measurements are positively correlated.
If your explanation used the words more data, look again. Pairing does not add data; seven students are seven students. It removes a source of noise from the data you have.
Exit ticket
This one is made up, so that you meet a fresh data set. Six office workers' typing speeds, in words per minute, were recorded before and after a one-week tutorial.
| worker | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| before | 52 | 61 | 45 | 70 | 58 | 49 |
| after | 56 | 63 | 51 | 71 | 62 | 50 |
Discussion prompt
Test at the 5 percent level whether typing speed is higher on average after the tutorial. Give the hypotheses, the statistic, the p-value and a conclusion in context.
Notice how small the numbers are: a standard deviation of exactly 2 and a mean of exactly 3, so the arithmetic is light and the reasoning is what is being tested. Every worker improved, by 1 to 6 words per minute, so a strong result is no surprise. Check yourself on the setup: six differences, five degrees of freedom, a right tail because higher after is positive with after first.
If you got a much larger p-value, you probably ran two independent samples: the workers' typing speeds range from 45 to 71, and that spread swamps a 3-word gain unless the pairing removes it.
Recap
A matched-pairs design measures each subject twice, or matches two subjects, so that every observation has a partner. The two samples are not independent, and the analysis uses the differences within pairs: the differences are the data.
| idea | formula or rule | read it as |
|---|---|---|
| design | every value has one partner | same subject twice, or a deliberate match |
| the data | d = x₁ − x₂, one per pair | one fixed direction, signs kept |
| parameter | μd | the population mean difference |
| hypotheses | H0: μd = 0 (or ≤, ≥) | tail from the claim, read through the subtraction |
| statistic | t = x̄d / (sd/√n) | the mean change in standard errors |
| degrees of freedom | df = n − 1 | n is the number of pairs |
| why it helps | sd² = s₁² + s₂² − 2r s₁ s₂ | shared variation cancels when r > 0 |
The worked examples showed both outcomes. Hypnotism, cholesterol and the throwing hands gave evidence of a change; the lifting class, the SAT class and the shot-put hands did not, and in each of those the right conclusion was insufficient evidence, never no effect.
Chapter 10's tests are now complete: two independent means, two proportions, and matched pairs. The question that picks between them is always the first one on the pattern slide: are the two samples independent, or does every value have a partner? The Introductory Business Statistics text covers the same paired test in business settings.
OpenStax Introductory Statistics 2e, §10.4 Matched or Paired Samples §10.4, pp. 527-532 — the whole section
OpenStax Introductory Business Statistics 2e, §10.6 Matched or Paired Samples §10.6 Matched or Paired Samples — the same test in business contexts
Want this taught 1-on-1? Alexander tutors Statistics — $55/session, free consultation.