29 CIs and tests: mean differences (paired data)
You have learnt to ask a RQ, design a study, classify and summarise the data, construct confidence intervals, and conduct hypothesis tests. In this chapter, you will learn to:
- identify situations where mean differences are appropriate.
- construct confidence intervals for a mean difference.
- conduct hypothesis tests for the mean difference with paired data.
- determine whether the conditions for using these methods apply in a given situation.

29.1 Introduction: six-minute walk test
The Six-Minute Walk Test (6MWT) measures how far subjects can walk in six minutes, and is used as a simple, low-cost evaluation of fitness and other health-related measures. The recommended setting for the test is usually a walkway of at least . Saiphoklang, Pugongchai, and Leelasittikul (2022) measured the 6MWT distance when the same subjects used both and walkways.
The comparison is within individuals (Sect. 2.4); this is a repeated-measures study. Each subject has a pair of 6MWT measurements, and the study produced paired data (below), the topic of this chapter.
Some differences are negative. This does not mean a negative distance. Since the differences are computed as the distance minus the distance, a negative difference means the distance is a larger value than the distance.
29.2 Paired data
The data above are paired. Computing the differences or changes between the pairs of observations makes sense, since the values for each pair belong to the same unit of analysis (the same person, in this case).
Pairing data, when appropriate, is useful because individuals can vary substantially. Pairing means that extraneous variables (potentially, confounding variables) are held constant for those paired observations. For example, each pair of measurements in the data above are recorded for the same person, so both measurements are recorded for someone of the same age, same sex, and with the same physical attributes.
Pairing is a form of blocking (Sect. 7.2). Pairing is a good design strategy when the individuals in the pair are the same, or are very similar for many extraneous variables. (For example, the pair may comprise two different people, of the same sex, with similar age, height and weight.) Pairing often involves taking two measurements from the same individuals, as in the data above.
Definition 29.1 (Paired data) Paired data occurs when the outcome is compared for two different, distinct situations for each unit of analysis.
Paired studies appear in many situations; as examples:
- Heart rate is measured for each twin in a pair (the twin-pair is the 'individual'), one of whom exercises regularly and one who does not. Pairing the twins is reasonable, given the shared genetics (and probably childhood environments also). The difference between the hearts rates of the twins can be recorded for each pair.
- The body temperature of dogs (the 'individuals') is measured using both rectal and ear thermometers for each dog. The difference between the two recorded temperatures from the thermometers for each dog is recorded.
- Blood pressure is recorded from some individuals (Group A) after receiving Drug A, and from another group of individuals (Group B) after receiving Drug B. Each person in Group A is matched with someone in Group B of the same sex, similar age and similar weight (e.g., in one of the pairs, both individuals are male, about years-of-age, and about tall). The difference between the blood pressure measurements for the individual in Group A and the matched person in Group B is recorded for each pair.
- The number of campers is recorded at many national parks (the 'individuals') on the first weekend in summer, and on the first weekend in winter. The difference in camper numbers for each national park between these time points is recorded.
Many of these examples can be extended to beyond two measurements. For instance, temperatures can be compared on each dog using three different types of thermometers. We only study pairs of measurements, and only for quantitative variables.
29.3 Summarising the data
For the 6MWT study, the distance is measured for the same subjects for two different walkway distances. Each subject receives two measurements, and the difference between the distances walked for each individual is computed.
Since the data are paired, an appropriate graph is a histogram of the differences (Sect. 13.3.1); specifically, distance minus the distance. A boxplot comparing 6MWT distance for both walkway lengths (that is, not pairing the data) shows the distribution of distances, and the median distances, are very similar (Fig. 29.1, left panel). Any difference in individuals' 6MWT distances is difficult to see and detect. In addition, linking the and distances that belong together for each individual patient is not possible,
Using a histogram of the differences makes the individuals' differences easier to see (Fig. 29.1, right panel). The histogram also makes it easy to see that some subjects walked further with a walkway, and some further for a walkway. Individually graphing the distances for both walkway distances may also be useful too (using two histograms), but a graph of the differences is crucial, as the RQ is about those differences. A case-profile plot (Sect. 13.3.2) is also appropriate, but is difficult to read for these data because sample size is large (a line is needed for each of the units of analysis).

FIGURE 29.1: Plots of the 6MWT data. Left: graphing the data incorrectly as unpaired. Right: a histogram of 6MWT distances changes ( walkway distance minus walkway distance; the vertical grey line represents no change in distance).
The 6MWT distances for each walkway length can be summarised individually (the first two rows of Table 29.1) using the methods of Chap. 23, using software (Fig. 29.2). All statistics are slightly different for the two walkway distances; in particular, the mean walkway distance is slightly larger. However, since the RQ is about the difference between the distances, a numerical summary of the differences is essential (third row of Table 29.1, based on Fig. 29.2). Notice that the third row of information is computed from the values in the Diff. column in the data above, not by (for instance) finding the difference between the standard deviations in the first two rows.
Mean | Median | Std deviation | Std error | Sample size | |
---|---|---|---|---|---|
20m walkway distance (in m) | |||||
30m walkway distance (in m) | |||||
Difference (in m) |


FIGURE 29.2: The 6MWT data: numerical summary software output for each group (top), and the CI and test results (bottom).
The differences (i.e., the Diff. column in the data given in Sect. 29.1) can be treated like a single sample of data (Table 29.2), with the notation adapted accordingly:
- : the mean difference in the population (in m).
- : the mean difference in the sample (in m).
- : the sample standard deviation of the differences (in m).
- : the number of differences.
One sample mean | Mean difference | |
---|---|---|
The observations: | Values: | Differences: |
Population mean: | ||
Sample mean: | ||
Standard deviation: | ||
Standard error of : | ||
Sample size: | Number of observations: | Number of differences: |
29.4 Confidence intervals for
The data in Sect. 29.1 can be used to answer this repeated-measures, estimation RQ:
For Thai patients with chronic obstructive pulmonary disease, what is the mean difference between the 6MWT distance when subjects use a walkway and a walkway?
Every possible sample of subjects comprises different people, and hence produces different 6MWT distances for and walkways. For this reason, the 6MWT distance summaries in Table 29.1 include standard errors. Since the 6MWT distance varies from sample to sample for each person, the difference between the distances for each person varies from sample to sample too, and also have a sampling distribution.
Definition 29.2 (Sampling distribution of a sample mean difference) The sampling distribution of a sample mean difference is (when certain conditions are met; Sect. 29.6) described by:
- an approximate normal distribution,
- centred around the sampling mean whose value is the population mean difference ,
- with a standard deviation, called the standard error of the difference, of ,
where is the number of differences, and is the standard deviation of the individual differences in the sample.
For the 6MWT data, the sample mean differences are described by (Fig. 29.3):
- approximate normal distribution,
- with a sampling mean whose value is ,
- with a standard error of

FIGURE 29.3: The sampling distribution is a normal distribution; it describes how the sample mean difference between the 6MWT distances varies in samples of size .
The CI for the mean difference has the same form as for a single mean (Chap. 23). The % confidence interval (CI) for is As usual when the sampling distribution has an approximate normal distribution, an approximate % confidence interval (CI) uses the approximate multiplier of (from the ---- rule). This is the same as the CI for if the differences are treated as the data.
For the 6MWT data: or (so the margin of error is ). Equivalently, the CI is from , up to . We write:
The mean difference in the 6MWT distances when using a and walkway is (; ), with an approximate % CI from to , further for a walkway.
The CI means that the reasonable values for the population mean difference in 6MTW distances are between and . Alternatively, we are % confident that the population mean difference between the 6MWT distances is between and (further for walkway). A difference of this magnitude probably has practical importance. Also notice that the direction of the difference is given: 'further for walkway'.
Statistical software produces exact % CIs, which may be slightly different from the approximate % CI (recall: the ---- rule gives approximate multipliers). For the 6MWT data, the approximate and exact % CIs are the same to one decimal place (Fig. 29.2). We write:
The mean difference in the 6MWT distances when using a and walkway is (; ), with a % CI from to further for a walkway.
29.5 Hypothesis tests for : -test
The data in Sect. 29.1 can be used to answer this repeated-measures, decision-making RQ:
For Thai patients with chronic obstructive pulmonary disease, is there a mean increase in 6MWT distance using a walkway compared to a walkway?
In Sect. 29.1, the differences were defined as the distance minus the distance, which is consistent with the wording in this RQ. This RQ asks if the mean walking distance is, in general, a smaller value when subjects use a walkway compared to a walkway (that is how a positive difference will be found). The parameter is the population mean difference in 6MWT, . The RQ is one-tailed, since the shorter walkway means more time spent changing direction, possibly negatively impacting the walking distance.
The null hypothesis is that 'there is no mean change in 6MWT, in the population' (Sect. 28.2):
- : .
This hypothesis, which we initially assume to be true, postulates that the mean reduction may not be zero in the sample, due to sampling variation.
Since the RQ asks specifically if the mean distance is smaller for a walkway, the alternative hypothesis is one-tailed (Sect. 28.2). According to how the differences have been defined, the alternative hypothesis is:
- : (i.e., one-tailed).
This hypothesis says that the mean change in the population is greater than zero, because of the wording of the RQ, and because of how the differences were defined. If the differences were defined in the opposite way (as 'the distance minus the distance') then the alternative hypothesis would be , which has the same meaning.
The sampling distribution, as described in Sect. 29.2, still applies, where is assumed to be the value given in (see Fig. 29.4):
- an approximate normal distribution,
- centred around the sampling mean whose value is the population mean difference (from ),
- with a standard deviation of (from Eq. (29.1)).
The sample mean difference can be located on the sampling distribution by computing the -score: following the ideas in Eq. (27.1). Software displays the same -score (Fig. 29.2). This is a huge -score.

FIGURE 29.4: The sampling distribution is a normal distribution; it describes how the sample mean difference between the 6MWT distances varies in samples of size .
A -value determines if the sample data are consistent with the assumption (Table 28.1). Since , and since -scores are like -scores, the one-tailed -value will be very small (based on the ---- rule). Software (Fig. 29.2) reports that the two-tailed -value is less than . Hence, the one-tailed -value is less than .
The software clarifies how the differences have been computed.
At the left of the output (Fig. 29.2), the order implies the differences are found as Distance30
(the walk distance) minus Distance20
(the walk distance), the same as our definition.
The one-tailed -value is less than , suggesting very strong evidence (Table 28.1) to support . A conclusion requires an answer to the RQ, a summary of the evidence leading to that conclusion, and some summary statistics:
Very strong evidence exists in the sample (paired ; one-tailed ) of a mean reduction in 6MWT for a walkway compared to a walkway (mean reduction: ; % CI: to ; ).
Note that the direction of the difference is provided.
Saying 'there is evidence of a difference' is insufficient. You must state which measurement is, on average, higher (that is, what the differences mean).
29.6 Statistical validity conditions
As with any confidence interval and hypothesis test, these results apply under certain conditions. The conditions under which the results are statistically valid for paired data are similar to those for one sample mean, rephrased for differences.
Statistical validity can be assessed using these criteria:
- When , the CI is statistically valid. (If the distribution of the differences is highly skewed, the sample size may need to be larger.)
- When , the CI is statistically valid only if the data come from a population of differences with a normal distribution.
The sample size of is a rough figure; some books give other values (such as ).
This condition ensures that the distribution of the sample means has an approximate normal distribution (so that, for example, the ---- rule can be used). Provided the sample size is larger than about , this will be approximately true even if the distribution of the differences in the population does not have a normal distribution. That is, when the sample means generally have an approximate normal distribution, even if the data themselves don't have a normal distribution. The units of analysis are also assumed to be independent (e.g., from a simple random sample).
If the statistical validity conditions are not met, other methods (e.g., non-parametric methods (Conover 2003); resampling methods (Efron and Hastie 2021)) may be used. For paired qualitative data, McNemar's test can be used (Conover 2003).
Example 29.1 (Statistical validity) For the 6MWT data, the sample size is , so the results are statistically valid. Neither the differences in the population, nor the distances in the population for the individual walkway lengths, need to follow a normal distribution.
29.7 Example: invasive plants
Skypilot is an alpine wildflower native to the Colorado Rocky Mountains (USA). In recent years, a willow shrub (Salix) has been encroaching on skypilot territory and, because willow often flowers early, Kettenbach et al. (2017) studied whether the willow may 'negatively affect pollination regimes of resident alpine wildflower species' (p. ).
Data for both species was collected at different sites, so the data are paired by site (Sect. 29.1). The data are shown in Sect. 13.4. The parameter is , the population mean difference in day of first flowering for skypilot, less the day of first flowering for willow. A positive value for the difference means that the skypilot values are larger, and hence that willow flowered first. The RQ is:
In the Colorado Rocky Mountains, is there a mean difference between first-flowering day for the native skypilot and encroaching willow?
The hypotheses are where the alternative hypothesis is two-tailed, and is the mean difference between first-flowering day for the native skypilot and encroaching willow.
Explaining how the differences are computed is important. The differences here are skypilot minus willow first-flowering days.
However, the differences could be computed as willow minus skypilot first-flowering days. Either is fine, as long as you remain consistent. The meaning of any conclusions will be the same.
The data are summarised graphically in Fig. 13.5 and numerically (Table 29.3), using software output (Fig. 29.5).

FIGURE 29.5: Software output for the flowering-day data.
Mean | Standard deviation | Standard error | Sample size | |
---|---|---|---|---|
Willow (encroaching) | ||||
Skypilot (native) | ||||
Differences |
The standard error of the mean difference is (Fig. 29.5 or Table 29.3). The sampling distribution for has a normal distribution, centred around with a standard deviation of .
The approximate % CI for the mean difference is or from to days. The exact % CI (Fig. 29.5) is to days; the difference is because the approximate CI uses the approximate multiplier of from the ---- rule.
The value of the test statistic (i.e., the -score) is as in the output. This is a relatively small value of , so a large -value is expected using the ---- rule. Indeed, the output shows that : there is no evidence of a mean difference in first-flowering day (i.e., the sample mean difference could reasonably be explained by sampling variation if ).
Since positive differences mean willow flowers earlier, we write (using the exact CI):
No evidence exists (; two-tailed ) that the day of first-flowering is different for the encroaching willow and the native skypilot (mean difference: days earlier for willow; approximate % CI between days earlier for skypilot to days earlier for willow; ).
The CI is statistically valid since .
Be clear in your conclusion about how the differences are computed. Make sure to interpret the test and CI consistently with how the differences are defined.
We do not say whether the evidence supports the null hypothesis. We assume the null hypothesis is true, so we state how strong the evidence is to support the alternative hypothesis. The current sample presents no evidence to contradict the assumption (but future evidence may emerge).
29.8 Example: chamomile tea
Rafraf, Zemestani, and Asghari-Jafarabadi (2015) studied patients with Type 2 diabetes mellitus (T2DM). They randomly allocated patients into a control group (who drank hot water), and another patients to receive chamomile tea (p. 164):
The study was blinded so that the allocation of the intervention or control group was concealed from the researchers and statistician [...] The intervention group () consumed one cup of chamomile tea [...] three times a day immediately after meals (breakfast, lunch, and dinner) for weeks. The control group () consumed an equivalent volume of warm water during the -week period...
The total glucose (TG) was measured for each individual both before the intervention and after eight weeks on the intervention, in both the control and treatment groups. The data are not available, so no graphical summary of the data can be produced; however, the article gives a data summary (motivating Table 29.4).
Mean | Std dev. | Mean | Std dev. | Mean | Std dev. | Std error | ||
---|---|---|---|---|---|---|---|---|
Chamomile tea | ||||||||
Control | ||||||||
Difference |
Is there a mean reduction in TG in either group? Estimates of the mean reduction in each group can be found by constructing a CI for each group. First, the standard errors for each reduction are needed:
- .
- .
Then the approximate % CIs are:
- , or from to mg.dl.
- , or from to mg.dl.
(A negative reduction in TG means an increase in TG.) The first CI suggests that the population mean difference is almost certainly larger than zero; the second suggests that a population mean difference of zero could reasonably have produced the sample data.
Of course, the sample mean differences in TG may be non-zero due to sampling variation. So, the following repeated-measures RQs can be asked:
- For patients with T2DM, is there a mean change in TG after eight weeks drinking chamomile tea?
- For patients with T2DM, is there a mean change in TG after eight weeks drinking hot water?
Then, the hypotheses are (where represent the mean change in TG (in mg.dl) after eight weeks):
- : vs : .
- : vs : .
The two test statistics are: where the subscripts and refer to the tea and hot-water groups respectively. The -score for the tea-drinking group is huge, so the two-tailed -value will be very small using the ---- rule, and certainly smaller than . This means that there is evidence that chamomile tea had an impact on the mean change in TG.
In contrast, the -score for the water-drinking group is small, so the two-tailed -value will be large using the ---- rule, and certainly larger than . This means there is no evidence that placebo treatment (hot water) had any impact on mean change in TG (as one might expect for a placebo).
We write:
There is very strong evidence (; two-tailed ) of a mean change in TG for the chamomile-drinking groups (mean reduction: .dl; approx. % CI: to .dl; ), but no evidence (; two-tailed ) of a mean change in the hot-water drinking group (mean reduction: .dl; approx. % CI: and .dl; ).
The intervals have a % chance of straddling the population mean reduction in TG. The sample sizes are larger than , so the results are statistically valid.
These hypothesis tests have allowed decisions to be made about each group individually. However, the two groups ultimately need to be compared so that the tea-drinking group and the water-drinking groups can be compared. This is considered in Sect. 30.8.
29.9 Chapter summary
To compute a confidence interval (CI) for a mean difference, compute the sample mean difference, , and identify the sample size . Then compute the standard error, which quantifies how much the value of varies across all possible samples: where is the sample standard deviation. The margin of error is (multiplierstandard error), where the multiplier is for an approximate % CI (using the ---- rule). Then the CI is: The statistical validity conditions should also be checked.
To test a hypothesis about a population mean difference :
- Write the null hypothesis () and the alternative hypothesis ().
- Initially assume the value of in the null hypothesis to be true.
- Then, describe the sampling distribution, which describes what to expect from the sample mean difference based on this assumption: under certain statistical validity conditions, the sample mean difference varies with:
- an approximate normal distribution,
- with sampling mean whose value is the value of (from ), and
- having a standard deviation of .
- Compute the value of the test statistic: where is the hypothesised value given in the null hypothesis.
- The -value is like a -score, and so an approximate -value can be estimated using the ---- rule, or found using software.
- Make a decision, and write a conclusion.
- Check the statistical validity conditions.
The following short video may help explain some of these concepts:
29.10 Quick review questions
Bacho et al. (2019) compared joint pain in stroke patients receiving a supervised exercise treatment. The same participants () were assessed before and after treatment. The mean improvement in joint pain after weeks was (with a standard error of ) measured using a standardised tool.
Are the following statements true or false?
- For paired data, the mean of the differences is treated like the mean of a single variable.
- An appropriate graph for displaying these data is a histogram of the differences.
- The population mean difference is denoted .
- The standard error of the sample mean difference is denoted .
- Only 'before and after' studies can be paired.
- The null hypothesis is about the population mean difference.
- The value of the test statistic is
- The approximate value of the two-tailed -value is very small.
- The 'test statistic' for this test is a -score.
29.11 Exercises
Answers to odd-numbered exercises are given at the end of the book.
Exercise 29.1 Which (if any) of these scenarios are paired?
- Heart rate is measured for each individual when sitting and when standing. (Some individuals have their heart rate recorded first while sitting, and some first while standing.) Each person receives two measurements, and the difference in heart rate between sitting and standing is recorded.
- The mean protein concentrations were compared in sea turtles before and after being rehabilitated (March et al. 2018).
Exercise 29.2 Which (if any) of these scenarios are paired?
- The mean HDL cholesterol concentration is recorded for a group of males and a group of females, and the means compared.
- Heart rate was recorded for people, both before and after exercise, to determine how much the average heart rate increase.
Exercise 29.3 A group of primary school children were asked to complete a certain task on both a personal computer (PC) and using a tablet computer.
If the differences were defined as the time to complete the task on the PC, minus the time to complete the same task on a tablet (one difference for each child), what do the difference mean?
Exercise 29.4 Suppose water quality was recorded upstream and downstream of different copper mines.
If the differences were defined as the pH downstream minus the water pH upstream for each river, what do the differences mean?
Exercise 29.5 Suppose, in the example of Sect. 29.7, the differences were defined as the day of first flowering for willow, less the day of first flowering for skypilot.
Write down, and interpret the meaning of, the confidence interval for the mean difference in first-flowering times.
Exercise 29.6 Suppose, in the example of Sect. 29.8, the differences were defined as increase in total glucose (TG).
Write down, and interpret the meaning of, the confidence interval for the mean increase in TG for the tea-drinking group.
Exercise 29.7 [Dataset: Fruit
]
Mukherjee, Deb, and Devy (2019) studied the effect of rainfall on growing Chayote squash (Sechium edule).
They compared the size of the fruit in a year with normal rainfall (2015) compared to a dry year (2014) on farms:
For Chayote squash grown in Bangalore, what is the mean difference in fruit weight between a normal and dry year?
Ten fruits were gathered from each farm in both years, and the average (mean) weight of the fruit recorded for the farm. Since the same farms are used in both years, the data are paired (below). Data is missing for Farm 20 in the dry year (2014), so there are differences.

FIGURE 29.6: Software output for the fruit data.
- What is the unit of analysis? What is the units of observation?
- What is the advantage of using the same farms twice each?
- Construct a suitable graph to display the differences.
- Create a numerical summary table for the data (use Fig. 29.6).
- What is the parameter? Carefully describe what it means.
- Write down the hypotheses.
- Sketch the sampling distribution.
- Compute the -score.
- Determine the -value.
- Construct an approximate % CI for the mean difference in fruit weight.
- Are the test and the CI statistically valid?
- Write a conclusion.
Exercise 29.8 [Dataset: Captopril
]
In a study of hypertension (Hand et al. 1996; MacGregor et al. 1979), patients were given a drug (Captopril) and their systolic blood pressure measured (in mm Hg) immediately before and two hours after being given the drug.
The aim is to see if there is evidence of a reduction in blood pressure after taking Captopril. Use the data (Table 13.5) and the software output (Fig. 29.7) to answer these questions.
- Explain why it is probably more sensible to compute differences as the Before minus the After measurements. What do the differences mean when computed this way?
- What is the advantage of using the same patients for both the before and after measurements, rather than one group for before measurements and a different group of people for after measurements?
- What is the parameter? Carefully describe what it means.
- Construct a suitable graph to display the differences.
- Write down the hypotheses.
- Sketch the sampling distribution.
- Write down the -score.
- Write down the -value.
- Write down the exact % CI using the computer output (Fig. 29.7).
- Compute an approximate % CI for the mean difference.
- Why are the two CIs different?
- Write a conclusion.
- Are the CI and test statistically valid?

FIGURE 29.7: Software output for the Captopril data.
Exercise 29.9 People often struggle to eat the recommended intake of vegetables. Fritts et al. (2018) explored ways to increase vegetable intake in teens. Teens rated the taste of raw broccoli, and raw broccoli served with a specially-made dip.
Each teen () had a pair of measurements: the taste rating of the broccoli with and without dip. Taste was assessed using a ' visual analogue scale', where a higher score means a better taste. In summary:
- For raw broccoli, the mean taste rating was (with a standard deviation of );
- For raw broccoli served with dip, the mean taste rating was (with a standard deviation of ).
Because the data are paired, the differences are the best way to describe the data. The mean difference in the ratings was , with standard error of .
- Construct a suitable numerical summary table.
- What does a positive difference mean?
- Perform a hypothesis test to see if the use of dip increases the mean taste rating.
- Compute the approximate % CI for the mean difference in taste ratings.
- Are the CI and test statistically valid?
Exercise 29.10 Allen et al. (2018) examined the effect of exercise on smoking. Men and women were assessed on their 'intention to smoke', both before and after exercise for each subject (using two quantitative questionnaires). Smokers ('smoking at least five cigarettes per day') aged to were enrolled for the study. For the women in the study, the mean intention to smoke after exercise reduced by (with a standard error of ). (Larger values for 'intention to smoke' mean a greater intent to smoke.)
- What does a positive difference mean?
- Perform a hypothesis test to determine if there is evidence of a population mean reduction in intention-to-smoke for women after exercising.
- Find an approximate % confidence interval for the population mean reduction in intention to smoke for women after exercising.
- Are the CI and test statistically valid?
Exercise 29.11 [Dataset: Ferritin
]
In a study (Cressie, Sheffield, and Whitford 1984) conducted at the Adelaide Children's Hospital (p. 107; emphasis added):
... a group of beta thalassemia patients [...] were treated by a continuous infusion of desferrioxamine, in order to reduce their ferritin content...
Using the data shown below, conduct a hypothesis test to determine if there is evidence that the treatment reduces the ferritin content, as intended. Make sure to include a % CI in the conclusion.
September | March | Reduction |
---|---|---|
Exercise 29.12 [Dataset: Stress
]
The concentration of beta-endorphins in the blood is a sign of stress.
Hoaglin, Mosteller, and Tukey (2011) measured the beta-endorphin concentration for patients about to undergo surgery (Hand et al. 1996).
Each patient had their beta-endorphin concentrations measured -- hours before surgery, and also before surgery.
A numerical summary (Table 29.6) was produced from output.
- Use the output to test the RQ.
- Use the software output in Fig. 29.8 to construct an approximate % CI for the increase in beta-endorphin concentrations as surgery gets closer.
- Use the software output in Fig. 29.8 to write down the exact % CI for the increase in beta-endorphin concentrations as surgery gets closer.
- Why is there a difference between the two CIs?
- Are the CI and test statistically valid?
Means | Std.deviation | Std.Error | Sample.size | |
---|---|---|---|---|
12--14 hours before surgery | ||||
10 minutes before surgery | ||||
Increase |

FIGURE 29.8: Software output for the surgery-stress data.
Exercise 29.13 A study of Spanish health students (Romero-Blanco et al. 2020) measured (among other things) the number of minutes of vigorous physical activity (PA) performed by students before and during the covid-19 lockdown (from March to April 2020 in Spain). Since the before and during lockdown were both measured on each participant, the data are paired. The data are summarised in Table 29.7.
- Explain what the differences mean.
- Compute the standard error of the differences.
- Perform a hypothesis test to compare the change in mean PA (including a CI).
Mean (mins) | Std dev. (mins) | |
---|---|---|
Before | ||
During | ||
Increase |
Exercise 29.14 What happens to students' eating habits when they start university? Many students will be responsible for their own meals for the first time, so some may forgo healthy foods for convenient, but less healthy, foods. Alternatively, some may not be able to afford sufficient or healthy food.
D. A. Levitsky, Halbmaier, and Mrdjenovic (2004) recorded some students' weights as they began university, and then the same students' weight some later time. They asked the RQ:
For Cornell University students, what is the mean weight change in students after weeks at university?
The data collected to answer this RQ are shown below (D. Levitsky, n.d.).
- Use the software output (Fig. 29.9) to compute an approximate % CI for the weight gain from Weeks to .
- Use the software output to write down an exact % CI for the weight gain from Weeks to .
- Comment on the two CIs.
- Are the CIs statistically valid?
- Conduct a hypothesis tests to determine if there is a change in mean weight gain from Weeks to .
- Do you think the weight gain would be of practical importance?


FIGURE 29.9: The weight-gain data: software output.
Exercise 29.15 [Dataset: Anorexia
]
Young girls with anorexia () received cognitive behavioural treatment (Hand et al. (1996)), and their weight before and after treatment were recorded.
In summary:
- Before the treatment, the mean weight was pounds ( pounds);
- After the treatment, the mean weight was pounds ( pounds).
The mean weight gain per girls was pounds, with a standard deviation of pounds. Find an approximate % CI for the population mean weight gain. Do you think the treatment had any meaningful impact on the mean weight gain of the girls, based solely on these data?
Exercise 29.16 [Dataset: SoilCN
]
Lambie, Mudge, and Stevenson (2021) compared the percentage nitrogen (%N) in soils from intensively-grazed irrigated and non-irrigated pastures.
The researchers paired similar irrigated and non-irrigated sites (p. 338):
The irrigated and non-irrigated pairs within each site were within of each other and were on the same soil, landform and usually the same farm with the same farm management...
One RQ in the study was:
For intensively grazed pastures sites, is there a mean reduction in percentage soil nitrogen (%N) when sites are irrigated, compared to non-irrigated?
The data are shown in the table below. Use the data to answer the RQ.


FIGURE 29.10: Software output for the nitrogen data. In the top table, the difference is implied as non-irrigated minus irrigated.
Exercise 29.17 [Dataset: Jumping
]
Hébert-Losier, Boswell-Smith, and Hanzlı́ková (2023) recorded double-legged jumping distance for healthy people, when they wore both shoes and were barefoot (Exercise 13.7).
Use the data to form a % CI to estimate the mean distance people can jump further when barefoot.
Exercise 29.18 [Dataset: WCTennis
]
Alberca et al. (2022) recorded the push-time for French wheelchair tennis players, while holding a racquet and not holding a racquet (Table 13.8; Alberca (2022)).
Use the data to form a % CI to estimate the mean difference between push-times with and without a racquet.