-
Notifications
You must be signed in to change notification settings - Fork 7
/
29-CIsTesting-MeanDifference.Rmd
1999 lines (1578 loc) · 84 KB
/
29-CIsTesting-MeanDifference.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# CIs and tests: mean differences (paired data) {#AnalysisPaired}
\index{Research question!relational}\index{Mean difference}
<!-- Introductions; easier to separate by format -->
```{r, child = if (knitr::is_html_output()) {'./introductions/29-CIsTesting-MeanDifference-HTML.Rmd'} else {'./introductions/29-CIsTesting-MeanDifference-LaTeX.Rmd'}}
```
<!-- Define colours as appropriate -->
```{r, child = if (knitr::is_html_output()) {'./children/coloursHTML.Rmd'} else {'./children/coloursLaTeX.Rmd'}}
```
## Introduction: six-minute walk test {#PairedIntro}
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\ $30\ms$.
@saiphoklang2022comparison measured the 6MWT distance when the same subjects used *both*\ $20\ms$ and\ $30\ms$\ walkways.
The comparison is *within* individuals (Sect.\ \@ref(RQsRepeatedMeasures));\index{Comparison!within individuals} this is a *repeated-measures* study.
Each subject has a *pair* of 6MWT measurements, and the study produced *paired data*
`r if (knitr::is_latex_output()) {
'(Table\\ \\@ref(tab:Data6MWT)),'
} else {
'(below),'
}`
the topic of this chapter.\index{Data!paired}\index{Study types!paired}
```{r Data6MWT}
data(SixMWT)
WTlen <- dim(SixMWT)[1]
Labels <- 1 : WTlen
tb1 <- array( cbind( Labels[1:5 ],
SixMWT$Distance20[1:5 ],
SixMWT$Distance30[1:5 ],
round( SixMWT$Distance30[1:5 ] - SixMWT$Distance20[1:5 ], 2)),
dim = c(5, 4) )
T1 <- knitr::kable(y <- pad(tb1,
surroundMaths = TRUE,
targetLength = c(0, 5, 5, 5),
decDigits = c(0, 1, 1, 1)),
format = "latex",
valign = 't',
align = "c",
linesep = "",
col.names = c("Person",
"$20\\ms$\\ w'way",
"$30\\ms$\\ w'way",
"Diff."),
row.names = FALSE,
escape = FALSE,
booktabs = TRUE) %>%
add_header_above(c( " " = 1,
"Distance walked (in m)" = 3),
line = TRUE,
bold = TRUE) %>%
row_spec(0, bold = TRUE)
tb2 <- array( cbind( Labels[(WTlen - 4):WTlen ],
SixMWT$Distance20[(WTlen - 4):WTlen ],
SixMWT$Distance20[(WTlen - 4):WTlen ],
SixMWT$Distance30[(WTlen - 4):WTlen ] - SixMWT$Distance20[(WTlen - 4):WTlen ]),
dim = c(5, 4) )
T2 <- knitr::kable(pad(tb2,
surroundMaths = TRUE,
targetLength = c(0, 5, 5, 4),
decDigits = c(0, 1, 1, 1)),
format = "latex",
valign = 't',
align = "c",
linesep = "",
col.names = c("Person",
"20\\ms\\ w'way",
"30\\ms\\ w'way",
"Diff."),
row.names = FALSE,
escape = FALSE,
booktabs = TRUE) %>%
add_header_above(c( " " = 1,
"Distance walked (in m)" = 3),
line = TRUE,
bold = TRUE) %>%
row_spec(0, bold = TRUE)
out <- knitr::kables(list(T1, T2),
format = "latex",
label = "Data6MWT",
caption = "The six-minute walk test (6MWT) distance, for walkways of $20\\ms$\\ and $30\\ms$\\ length. These are the first five and the last five of the $50$ total observations. (A negative difference means the $20\\ms$\\ distance is greater than the $30\\ms$\\ distance.)") %>%
kable_styling(font_size = 8)
out2 <- prepareSideBySideTable(out,
gap = "\\quad")
out2
```
```{r}
if( knitr::is_html_output() ) {
SixMWT$Diff <- round(SixMWT$Distance30 - SixMWT$Distance20, 2)
DT::datatable(SixMWT,
fillContainer = FALSE, # Make more room, so we don't just have ten values
colnames = c("Subject",
"Distance (20 m walkway)",
"Distance (30 m walkway)",
"Age",
"Difference"),
filter = "none",
options = list(searching = FALSE), # Remove searching: See: https://stackoverflow.com/questions/35624413/remove-search-option-but-leave-search-columns-option
caption = "The six-minute walk test (6MWT) distance, for walkways of $20\\ms$ and $30\\ms$ length. (A negative difference means the $20\\ms$ distance is greater than the $30\\ms$ distance.)")
}
```
::: {.importantBox .important data-latex="{iconmonstr-warning-8-240.png}"}
Some differences are *negative*.
This does *not* mean a negative distance.
Since the differences are computed as the $30\ms$\ distance minus the $20\ms$\ distance, a negative difference means the $20\ms$\ distance is a larger value than the $30\ms$\ distance.
:::
## Paired data {#PairedData}
\index{Data!paired}
<!-- The RQ is a special case of a *repeated-measures RQs* (Sect.\ \@ref(RQsRepeatedMeasures)),\index{Research question!repeated-measures} where each unit of analysis has just two observations. -->
The data
`r if( knitr::is_latex_output() ) {
'in Table\\ \\@ref(tab:SoilCN)'
} else {
'above'
}`
are *paired*.\index{Data!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\index{Variables!extraneous} (potentially, *confounding* variables)\index{Variables!confounding} are held constant for those paired observations.
For example, each pair of measurements in
`r if (knitr::is_latex_output()) {
'Table\\ \\@ref(tab:SoilCN)'
} else {
'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\index{Blocking} (Sect.\ \@ref(ManagingConfounding)).
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
`r if (knitr::is_latex_output()) {
'Table\\ \\@ref(tab:SoilCN).'
} else {
'the data above.'
}`
::: {.definition #PairedData name="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 $30$\ years-of-age, and about $180\cms$\ 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 on 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.
## Summarising the data {#SummarisingPairedCI}
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.\index{Mean difference}
Since the data are paired, an appropriate graph is a histogram of the differences (Sect.\ \@ref(HistoDiffPlot)); specifically, $30\ms$\ distance minus the $20\ms$\ 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.\ \@ref(fig:ComparePairedBoxplotsHistogram), left panel).
Any difference in individuals' 6MWT distances is difficult to see and detect.
In addition, linking the $20\ms$ and $30\ms$ 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.\ \@ref(fig:ComparePairedBoxplotsHistogram), right panel).
The histogram also makes it easy to see that some subjects walked further with a $20\ms$\ walkway, and some further for a $30\ms$\ 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.\ \@ref(CaseProfilePlot)) is also appropriate, but is difficult to read for these data because sample size is large (a line is needed for each of the $50$\ units of analysis).
(ref:WalkwayPlots) Plots of the 6MWT data. Left: graphing the data *incorrectly* as unpaired. Right: a histogram of 6MWT distances changes ($30\ms$\ walkway distance *minus* $20\ms$\ walkway distance; the vertical grey line represents no change in distance).
```{r ComparePairedBoxplotsHistogram, fig.align="center", out.width='95%', fig.cap="(ref:WalkwayPlots)", fig.height = 3.25, fig.width = 7.75}
par(mfrow = c(1, 2))
boxplot( cbind(SixMWT$Distance20,
SixMWT$Distance30),
names = c("20m", "30m"),
las = 1,
col = plot.colour,
ylim = c(180, 600),
ylab = "Walk distance (in m)",
xlab = "Walkway distance",
main = "POOR: A boxplot of 6MWT\ndistance for two walkway lengths")
out <- hist( SixMWT$Distance30 - SixMWT$Distance20,
breaks = seq(-40, 80, by = 10),
plot = FALSE)
plot(x = c(-40, 80),
y = c(0, 18),
xlim = c(-45, 80),
xlab = "Difference in distances (in m)",
ylab = "Frequency",
sub = "(30m distance minus 20m distance)",
las = 2,
type = "n",
main = "Histogram of 6MWT distance\nfor two walkway lengths")
box()
abline(v = 0,
col = "grey",
lty = 1,
lwd = 2)
plot(out,
add = TRUE,
col = plot.colour)
arrows(x0 = 5,
x1 = 75,
y0 = 16,
y1 = 16,
code = 2,
angle = 15,
length = 0.1,
col = "grey")
text( x = 45,
y = 16,
pos = 1,
cex = 0.9,
label = "30m greater")
arrows(x0 = -5,
x1 = -41,
y0 = 16,
y1 = 16,
code = 2,
angle = 15,
length = 0.1,
col = "grey")
text( x = -23,
y = 16,
pos = 1,
cex = 0.9,
label = "20m greater")
```
The 6MWT distances for each walkway length can be summarised individually (the first two rows of Table\ \@ref(tab:SMWTSummary)) using the methods of Chap.\ \@ref(OneMeanConfInterval), using software (Fig.\ \@ref(fig:SMWTNumericalOutput)).
All statistics are slightly different for the two walkway distances; in particular, the mean\ $30\ms$ 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\ \@ref(tab:SMWTSummary), based on Fig.\ \@ref(fig:SMWTNumericalOutput)).
Notice that the third row of information is computed from the values in the **Diff.** column in
`r if (knitr::is_latex_output()) {
'Table\\ \\@ref(tab:SoilCN),'
} else {
'the data above,'
}`
not by (for instance) finding the difference between the standard deviations in the first two rows.
```{r SMWTSummary}
SMWT.DataSummary <- array( dim = c(3, 5))
SMWT.DataSummary[1, 1] <- mean(SixMWT$Distance20)
SMWT.DataSummary[2, 1] <- mean(SixMWT$Distance30)
SMWT.DataSummary[3, 1] <- mean(SixMWT$Distance30 - SixMWT$Distance20)
SMWT.DataSummary[1, 2] <- median(SixMWT$Distance20)
SMWT.DataSummary[2, 2] <- median(SixMWT$Distance30)
SMWT.DataSummary[3, 2] <- median(SixMWT$Distance30 - SixMWT$Distance20)
SMWT.DataSummary[1, 3] <- sd(SixMWT$Distance20)
SMWT.DataSummary[2, 3] <- sd(SixMWT$Distance30)
SMWT.DataSummary[3, 3] <- sd(SixMWT$Distance30 - SixMWT$Distance20)
SMWT.DataSummary[1, 4] <- findStdError(SixMWT$Distance20)
SMWT.DataSummary[2, 4] <- findStdError(SixMWT$Distance30)
SMWT.DataSummary[3, 4] <- findStdError(SixMWT$Distance30 - SixMWT$Distance20)
SMWT.DataSummary[1, 5] <- realLength(SixMWT$Distance20)
SMWT.DataSummary[2, 5] <- realLength(SixMWT$Distance30)
SMWT.DataSummary[3, 5] <- realLength(SixMWT$Distance30 - SixMWT$Distance20)
rownames(SMWT.DataSummary) <- c("20m walkway distance (in m)",
"30m walkway distance (in m)",
"Difference (in m)")
if( knitr::is_latex_output() ) {
kable(pad(SMWT.DataSummary,
targetLength = c(6, 5, 6, 6, 2),
surroundMaths = TRUE,
decDigits = c(2, 1, 3, 3, 0)),
format = "latex",
booktabs = TRUE,
longtable = FALSE,
escape = FALSE,
align = "c",
col.names = c("Mean", "Median", "deviation", "error", "size"),
digits = 2,
caption = "The numerical summary of the 6MWT data. (The differences are the $30\\ms$\\ distances minus the $20\\ms$\\ differences.)") %>%
row_spec(0, bold = TRUE) %>%
row_spec(3, italic = TRUE) %>%
row_spec(2,
hline_after = TRUE) %>%
add_header_above(header = c(" " = 1,
" " = 1,
" " = 1,
"Standard" = 1,
"Standard",
"Sample"),
bold = TRUE,
line = FALSE,
align = "c") %>%
kable_styling(font_size = 8)
} else {
kable(pad(SMWT.DataSummary,
targetLength = c(6, 5, 6, 6, 2),
surroundMaths = TRUE,
decDigits = c(2, 1, 3, 3, 0)),
format = "html",
booktabs = TRUE,
longtable = FALSE,
escape = FALSE,
align = "c",
col.names = c("Mean", "Median", "Std deviation", "Std error", "Sample size"),
digits = 2,
caption = "The numerical summary of the 6MWT data.") %>%
row_spec(0, bold = TRUE)
}
```
```{r SMWTNumericalOutput, fig.cap="The 6MWT data: numerical summary software output for each group (top), and the CI and test results (bottom).", fig.align="center", out.width=c("65%","101%"), fig.show="hold"}
knitr::include_graphics("jamovi/SMWT/SMWT-NumericalSummary.png")
knitr::include_graphics("jamovi/SMWT/SMWT-PairedT.png")
```
The differences (i.e., the **Diff.**\ column in
`r if (knitr::is_latex_output()) {
'Table\\ \\@ref(tab:Data6MWT))'
} else {
'the data given in Sect.\\ \\@ref(PairedIntro))'
}`
can be treated like a single sample of data (Table\ \@ref(tab:PairedNotation)), with the notation adapted accordingly:
* $\mu_d$: the mean *difference* in the *population* (in m).
* $\bar{d}$: the mean *difference* in the *sample* (in m).
* $s_d$: the *sample* standard deviation of the *differences* (in m).
* $n$: the number of *differences*.
```{r PairedNotation}
DiffNotation <- array(dim = c(6, 2))
colnames(DiffNotation) <- c( "One sample mean",
"Mean difference")
rownames(DiffNotation) <- c( "The observations:",
"Population mean:",
"Sample mean:",
"Standard deviation:",
"Standard error of $\\bar{x}$:",
"Sample size:")
if( knitr::is_latex_output() ) {
DiffNotation[1, ] <- c( "Values: $x$",
"Differences: $d$")
DiffNotation[2, ] <- c( "$\\mu$",
"$\\mu_d$")
DiffNotation[3, ] <- c( "$\\bar{x}$",
"$\\bar{d}$")
DiffNotation[4, ] <- c( "$s$",
"$s_d$")
DiffNotation[5, ] <- c( "$\\displaystyle\\text{s.e.}(\\bar{x}) = \\frac{s}{\\sqrt{n}}$",
"$\\displaystyle\\text{s.e.}(\\bar{d}) = \\frac{s_d}{\\sqrt{n}}$")
DiffNotation[6, ] <- c( "Number of \\emph{observations}: $n$",
"Number of \\emph{differences}: $n$")
kable( DiffNotation,
format = "latex",
booktabs = TRUE,
align = c("c", "c"),
longtable = FALSE,
escape = FALSE,
col.names = colnames(DiffNotation),
caption = "The notation used for mean differences (paired data) compared to the notation used for one sample mean.") %>%
kable_styling(font_size = 8) %>%
row_spec(0, bold = TRUE)
}
if( knitr::is_html_output() ) {
DiffNotation[1, ] <- c( "Values: $x$",
"Differences: $d$")
DiffNotation[2, ] <- c( "$\\mu$",
"$\\mu_d$")
DiffNotation[3, ] <- c( "$\\bar{x}$",
"$\\bar{d}$")
DiffNotation[4, ] <- c( "$s$",
"$s_d$")
DiffNotation[5, ] <- c( "$\\displaystyle\\text{s.e.}(\\bar{x}) = \\frac{s}{\\sqrt{n}}$",
"$\\displaystyle\\text{s.e.}(\\bar{d}) = \\frac{s_d}{\\sqrt{n}}$")
DiffNotation[6, ] <- c( "Number of *observations*: $n$",
"Number of *differences*: $n$")
kable( DiffNotation,
format = "html",
booktabs = TRUE,
longtable = FALSE,
align = c("c", "c"),
col.names = colnames(DiffNotation),
caption = "The notation used for mean differences (paired data) compared to the notation used for one sample mean.") %>%
row_spec(0, bold = TRUE)
}
```
## Confidence intervals for $\mu_d$ {#MeanDiffCI}
\index{Sampling distribution!paired quantitative data}\index{Confidence intervals!paired quantitative data|(}
The data in
`r if (knitr::is_latex_output()) {
'Table\\ \\@ref(tab:Data6MWT)'
} else {
'Sect.\\ \\@ref(PairedIntro)'
}`
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\ $20\ms$ walkway and a\ $30\ms$ walkway?
Every possible sample of $n = 50$ subjects comprises different people, and hence produces different 6MWT distances for\ $20\ms$ and\ $30\ms$ walkways.
For this reason, the 6MWT distance summaries in Table\ \@ref(tab:SMWTSummary) 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 #DEFSamplingDistributionDbar name="Sampling distribution of a sample mean difference"}
The *sampling distribution of a sample mean difference* is (when certain conditions are met; Sect.\ \@ref(ValiditySampleMeanDiff)) described by:
* an approximate normal distribution,
* centred around the *sampling mean* whose value is the population mean *difference*\ $\mu_d$,
* with a standard deviation, called the standard error of the difference, of
$\displaystyle\text{s.e.}(\bar{d}) = \frac{s_d}{\sqrt{n}}$,
where\ $n$ is the number of differences, and\ $s_d$ is the standard deviation of the individual differences in the sample.
:::
<!-- ```{r PairedNotation} -->
<!-- DiffNotation <- array(dim = c(6, 2)) -->
<!-- colnames(DiffNotation) <- c( "One sample mean", -->
<!-- "Mean difference") -->
<!-- rownames(DiffNotation) <- c( "The observations:", -->
<!-- "Sample mean:", -->
<!-- "Standard deviation:", -->
<!-- "Standard error of $\\bar{x}$:", -->
<!-- "Sample size:", -->
<!-- "Confidence interval:") -->
<!-- if( knitr::is_latex_output() ) { -->
<!-- DiffNotation[1, ] <- c( "Values: $x$", -->
<!-- "Differences: $d$") -->
<!-- DiffNotation[2, ] <- c( "$\\bar{x}$", -->
<!-- "$\\bar{d}$") -->
<!-- DiffNotation[3, ] <- c( "$s$", -->
<!-- "$s_d$") -->
<!-- DiffNotation[4, ] <- c( "$\\displaystyle\\text{s.e.}(\\bar{x}) = \\frac{s}{\\sqrt{n}}$", -->
<!-- "$\\displaystyle\\text{s.e.}(\\bar{d}) = \\frac{s_d}{\\sqrt{n}}$") -->
<!-- DiffNotation[5, ] <- c( "Number of \\emph{observations}: $n$", -->
<!-- "Number of \\emph{differences}: $n$") -->
<!-- DiffNotation[6, ] <- c( "$\\bar{x}\\pm\\big(\\text{multiplier}\\times \\text{s.e.}(\\bar{x})\\big)$", -->
<!-- "$\\bar{d}\\pm\\big(\\text{multiplier}\\times \\text{s.e.}(\\bar{d})\\big)$") -->
<!-- kable( DiffNotation, -->
<!-- format = "latex", -->
<!-- booktabs = TRUE, -->
<!-- align = c("c", "c"), -->
<!-- longtable = FALSE, -->
<!-- escape = FALSE, -->
<!-- col.names = colnames(DiffNotation), -->
<!-- caption = "The notation used for mean differences (paired data) compared to the notation used for one sample mean.") %>% -->
<!-- kable_styling(font_size = 8) %>% -->
<!-- row_spec(0, bold = TRUE) -->
<!-- } -->
<!-- if( knitr::is_html_output() ) { -->
<!-- DiffNotation[1, ] <- c( "Values: $x$", -->
<!-- "Differences: $d$") -->
<!-- DiffNotation[2, ] <- c( "$\\bar{x}$", -->
<!-- "$\\bar{d}$") -->
<!-- DiffNotation[3, ] <- c( "$s$", -->
<!-- "$s_d$") -->
<!-- DiffNotation[4, ] <- c( "$\\displaystyle\\text{s.e.}(\\bar{x}) = \\frac{s}{\\sqrt{n}}$", -->
<!-- "$\\displaystyle\\text{s.e.}(\\bar{d}) = \\frac{s_d}{\\sqrt{n}}$") -->
<!-- DiffNotation[5, ] <- c( "Number of *observations*: $n$", -->
<!-- "Number of *differences*: $n$") -->
<!-- DiffNotation[6, ] <- c( "$\\bar{x}\\pm\\big(\\text{multiplier}\\times \\text{s.e.}(\\bar{x})\\big)$", -->
<!-- "$\\bar{d}\\pm\\big(\\text{multiplier}\\times \\text{s.e.}(\\bar{d})\\big)$") -->
<!-- kable( DiffNotation, -->
<!-- format = "html", -->
<!-- booktabs = TRUE, -->
<!-- longtable = FALSE, -->
<!-- align = c("c", "c"), -->
<!-- col.names = colnames(DiffNotation), -->
<!-- caption = "The notation used for mean differences (paired data) compared to the notation used for one sample mean.") %>% -->
<!-- row_spec(0, bold = TRUE) -->
<!-- } -->
<!-- ``` -->
For the 6MWT data, the sample mean differences\ $\bar{d}$ are described by (Fig.\ \@ref(fig:SMWTSamplingDist)):
* approximate normal distribution,
* with a sampling mean whose value is\ $\mu_{{d}}$,
* with a *standard error* of
\begin{equation}
\text{s.e.}(\bar{d}) = \frac{22.039}{\sqrt{50}} = 3.117.
(\#eq:StdErrorDifferences)
\end{equation}
```{r SMWTSamplingDist, fig.cap="The sampling distribution is a normal distribution; it describes how the sample mean difference between the 6MWT distances varies in samples of size $n = 50$.", fig.align="center", fig.width=9.25, fig.height=2.5, out.width='100%'}
mn <- mean(SixMWT$Distance20 - SixMWT$Distance30)
n <- length(SixMWT$Distance20)
stdd <- sd(SixMWT$Distance20 - SixMWT$Distance30)
se <- stdd/sqrt(n)
par( mar = c(4, 0.25, 0.5, 0.25) )
out <- plotNormal(0,
se,
xlab = "Sample mean difference in 6MWT distances (in m)",
cex.axis = 0.95,
ylim = c(0, 0.18),
xlim.hi = 0 + 3.25 * se,
xlim.lo = 0 - 3.25 * se,
showXlabels = c(
expression( mu[d]-"9.350"),
expression( mu[d]-6.234),
expression( mu[d]-3.117),
expression( mu[d] ),
expression( mu[d] + 3.117),
expression( mu[d] + 6.234),
expression( mu[d] + "9.350") ) )
arrows(x0 = 0,
x1 = 0,
y0 = max(out$y) * 1.25,
y1 = max(out$y),
angle = 15,
length = 0.1)
text(x = 0,
y = max(out$y) * 1.2,
pos = 3,
labels = expression(Sampling~mean~difference))
arrows(x0 = 0,
x1 = 0 + se,
y0 = 0.30 * max(out$y),
y1 = 0.30 * max(out$y),
code = 3, # Arrows both ends
angle = 15,
length = 0.1)
text(x = 0 + (se / 2),
y = 0.30 * max(out$y),
labels = expression( atop(Std~error,
s.e.(bar(italic(d)))==3.117)) )
arrows(x0 = mn,
x1 = mn,
y0 = 0.7 * max(out$y),
y1 = 0,
angle = 15,
length = 0.1)
text(x = mn,
y = 0.7 * max(out$y),
pos = 3,
labels = expression(bar(italic(d)) == 0.0282) )
```
The CI for the mean difference has the same form as for a single mean (Chap.\ \@ref(OneMeanConfInterval)).
The $95$%\ confidence interval (CI) for\ $\mu_d$ is
$$
\bar{d} \pm \big(\text{multiplier} \times\text{s.e.}(\bar{d})\big).
$$
As usual when the sampling distribution has an approximate normal distribution, an approximate $95$%\ confidence interval (CI) uses the approximate multiplier of\ $2$ (from the $68$--$95$--$99.7$ rule).
This is the same as the CI for\ $\bar{x}$ if the differences are treated as the data.
For the 6MWT data:
$$
22.03 \pm (2 \times 3.117),
$$
or $22.03\pm 6.234\ms$ (so the *margin of error* is\ $6.234\ms$).
Equivalently, the CI is from $22.03 - 6.234 = 15.796\ms$, up to $22.03 + 6.234 = 28.264\ms$.
We write:
> The mean difference in the 6MWT distances when using a\ $20\ms$ and\ $30\ms$ walkway is\ $22.03\ms$ ($\text{s.e.} = 3.117$; $n = 50$), with an approximate $95$%\ CI from\ $15.80\ms$ to\ $28.26\ms$, further for a $30\ms$\ walkway.
The CI means that the reasonable values for the population mean difference in 6MTW distances are between\ $15.80\ms$ and\ $28.26\ms$.
Alternatively, we are $95$%\ confident that the population mean difference between the 6MWT distances is between\ $15.80\ms$ and\ $28.26\ms$ (further for $30\ms$\ walkway).
A difference of this magnitude probably has practical importance.\index{Practical importance}
Also notice that the *direction* of the difference is given: 'further for $30\ms$\ walkway'.
<iframe src="https://learningapps.org/watch?v=piue8vvyk22" style="border:0px;width:100%;height:600px" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
Statistical software\index{Software output!mean differences} produces *exact* $95$%\ CIs, which may be slightly different from the *approximate* $95$%\ CI (recall: the $68$--$95$--$99.7$ rule gives *approximate* multipliers).
For the 6MWT data, the *approximate* and *exact* $95$%\ CIs are the same to one decimal place (Fig.\ \@ref(fig:SMWTNumericalOutput)).
We write:
> The mean difference in the 6MWT distances when using a\ $20\ms$ and\ $30\ms$ walkway is $22.03\ms$ ($\text{s.e.} = 3.117$; $n = 50$), with a $95$%\ CI from\ $15.76\ms$ to\ $28.29\ms$ further for a $30\ms$\ walkway.
\index{Confidence intervals!paired quantitative data|)}
## Hypothesis tests for $\mu_d$: $t$-test {#MeanDiffTest}
\index{Sampling distribution!paired quantitative data}\index{Hypothesis testing!paired quantitative data|(}
The data in
`r if (knitr::is_latex_output()) {
'Table\\ \\@ref(tab:Data6MWT)'
} else {
'Sect.\\ \\@ref(PairedIntro)'
}`
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\ $30\ms$ walkway compared to a $20\ms$ walkway?
In Sect.\ \@ref(PairedIntro), the differences were defined as the $30\ms$\ distance minus the $20\ms$\ 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\ $20\ms$ walkway compared to a\ $30\ms$ walkway (that is how a *positive* difference will be found).
The *parameter* is the *population mean difference* in 6MWT, $\mu_d$.
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.\ \@ref(AboutHypotheses)):
* $H_0$: $\mu_d = 0$.
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 $20\ms$ walkway, the alternative hypothesis is *one-tailed* (Sect.\ \@ref(AboutHypotheses)).
According to how the differences have been defined, the alternative hypothesis is:
* $H_1$: $\mu_d > 0$ (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 $20\ms$\ distance minus the $30\ms$\ distance') then the alternative hypothesis would be $\mu_d < 0$, which has the same *meaning*.
The sampling distribution, as described in Sect.\ \@ref(def:DEFSamplingDistributionDbar), still applies, where $\mu_d$ is assumed to be the value given in $H_0$ (see Fig.\ \@ref(fig:SMWTSamplingDistHT)):
* an approximate normal distribution,
* centred around the *sampling mean* whose value is the population mean *difference*\ $\mu_d = 0$ (from $H_0$),
* with a standard deviation of $\displaystyle\text{s.e.}(\bar{d}) = 3.117$ (from Eq.\ \@ref(eq:StdErrorDifferences)).
The sample mean difference can be located on the sampling distribution by computing the $t$-score:\index{Hypothesis testing!mean difference}\index{Test statistic!t@$t$-score}
$$
t
= \frac{\bar{d} - \mu_{d}}{\text{s.e.}(\bar{d})}
= \frac{22.026 - 0}{3.117} = 7.07,
$$
following the ideas in Eq.\ \@ref(eq:tscore).
Software displays the same $t$-score (Fig.\ \@ref(fig:SMWTNumericalOutput)).
This is a *huge* $t$-score.
```{r SMWTSamplingDistHT, fig.cap="The sampling distribution is a normal distribution; it describes how the sample mean difference between the 6MWT distances varies in samples of size $n = 50$.", fig.align="center", fig.width=9.25, fig.height=2.5, out.width='100%'}
mn <- mean(SixMWT$Distance20 - SixMWT$Distance30)
n <- length(SixMWT$Distance20)
stdd <- sd(SixMWT$Distance20 - SixMWT$Distance30)
se <- stdd/sqrt(n)
par( mar = c(4, 0.25, 0.5, 0.25) )
out <- plotNormal(0,
se,
xlab = "Sample mean difference in 6MWT distances (in m)",
cex.axis = 0.95,
ylim = c(0, 0.18),
xlim.hi = 0 + 3.25 * se,
xlim.lo = 0 - 3.25 * se,
# showXlabels = c(
# expression( -9.35),
# expression( -6.234),
# expression( -3.117),
# expression( 0 ),
# expression( 3.117),
# expression( 6.234),
# expression( 9.350) )
)
arrows(x0 = 0,
x1 = 0,
y0 = max(out$y) * 1.25,
y1 = max(out$y),
angle = 15,
length = 0.1)
text(x = 0,
y = max(out$y) * 1.2,
pos = 3,
labels = expression(Sampling~mean~difference))
arrows(x0 = 0,
x1 = 0 + se,
y0 = 0.30 * max(out$y),
y1 = 0.30 * max(out$y),
code = 3, # Arrows both ends
angle = 15,
length = 0.1)
text(x = 0 + (se / 2),
y = 0.30 * max(out$y),
labels = expression( atop(Std~error,
s.e.(bar(italic(d)))==3.117)) )
arrows(x0 = mn,
x1 = mn,
y0 = 0.7 * max(out$y),
y1 = 0,
angle = 15,
length = 0.1)
text(x = mn,
y = 0.7 * max(out$y),
pos = 3,
labels = expression(bar(italic(d)) == 0.0282) )
```
A $P$-value determines if the sample data are consistent with the assumption (Table\ \@ref(tab:PvaluesInterpretation)).
Since $t = 7.07$, and since $t$-scores are like $z$-scores, the *one*-tailed $P$-value will be very small (based on the $68$--$95$--$99.7$ rule).\index{68@$68$--$95$--$99.7$ rule}
Software (Fig.\ \@ref(fig:SMWTNumericalOutput)) reports that the *two*-tailed $P$-value is less than\ $0.0001$.
Hence, the *one*-tailed $P$-value is less than $0.0001/2 = 0.00005$.
::: {.importantBox .important data-latex="{iconmonstr-warning-8-240.png}"}
The software clarifies *how* the differences have been computed.
At the left of the output (Fig.\ \@ref(fig:SMWTNumericalOutput)), the order implies the differences are found as `Distance30` (the $30\ms$ walk distance) minus `Distance20` (the $20\ms$ walk distance), the same as our definition.
:::
`r if (knitr::is_latex_output()) '<!--'`
<iframe src="https://learningapps.org/watch?v=pj3pt56fk22" style="border:0px;width:100%;height:500px" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
`r if (knitr::is_latex_output()) '-->'`
The one-tailed $P$-value is less than\ $0.00005$, suggesting very strong evidence (Table\ \@ref(tab:PvaluesInterpretation)) to support $H_1$.
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 $t = 7.07$; one-tailed $P < 0.0005$) of a mean reduction in 6MWT for a $20\ms$ walkway compared to a $30\ms$ walkway (mean reduction: $22.03\ms$; $95$% CI: $15.76\ms$ to\ $28.29\ms$; $n = 50$).
Note that the direction of the difference is provided.
::: {.importantBox .important data-latex="{iconmonstr-warning-8-240.png}"}
Saying 'there is evidence of a difference' is insufficient.
You must state *which* measurement is, on average, higher (that is, what the differences *mean*).
:::
\index{Hypothesis testing!paired quantitative data|)}
## Statistical validity conditions {#ValiditySampleMeanDiff}
\index{Sampling distribution!mean difference}\index{Statistical validity (for inference)!mean differences}
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 $n \ge 25$, the CI is statistically valid.
(If the distribution of the differences is highly skewed, the sample size may need to be larger.)
* When $n < 25$, the CI is statistically valid only if the data come from a *population* of differences with a normal distribution.
The sample size of\ $25$ is a rough figure; some books give other values (such as\ $30$).
This condition ensures that the *distribution of the sample means has an approximate normal distribution* (so that, for example, the $68$--$95$--$99.7$ rule can be used).
Provided the sample size is larger than about\ $25$, this will be approximately true *even if* the distribution of the differences in the population does not have a normal distribution.
That is, when $n \ge 25$ 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\index{Non-parametric statistics} [@conover2003practical]; resampling methods\index{Resampling methods} [@efron2021computer]) may be used.
For paired qualitative data, McNemar's test can be used [@conover2003practical].
::: {.example #StatisticalValidityWeightGain name="Statistical validity"}
For the 6MWT data, the sample size is $n = 50$, 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.
:::
## Example: invasive plants {#PairedInvasivePlants}
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, @kettenbach2017shrub studied whether the willow may 'negatively affect pollination regimes of resident alpine wildflower species' (p.\ $6\,965$).
Data for both species was collected at $n = 25$ different sites, so the data are *paired* by site (Sect.\ \@ref(PairedIntro)).\index{Data!paired}
The data are shown in
`r if( knitr::is_latex_output() ) {
'Table\\ \\@ref(tab:FloweringData).'
} else {
'Sect.\\ \\@ref(CompareWithinInvasivePlants).'
}`
The parameter is\ $\mu_d$, 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
$$
\text{$H_0$: $\mu_d = 0$}\quad\text{and}\quad\text{$H_1$: $\mu_d\ne 0$},
$$
where the alternative hypothesis is two-tailed, and $\mu_d$ is the mean difference between first-flowering day for the native skypilot and encroaching willow.
::: {.tipBox .tip data-latex="{iconmonstr-info-6-240.png}"}
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.\ \@ref(fig:FloweringPlots) and numerically (Table\ \@ref(tab:FloweringSummaryHT)), using software output (Fig.\ \@ref(fig:FloweringjamoviHT)).
```{r FloweringjamoviHT, fig.cap="Software output for the flowering-day data.", fig.align="center", out.width=c("100%"), fig.show='hold'}
knitr::include_graphics("jamovi/Flowering/FloweringAll.png")
```
```{r FloweringSummaryHT}
data(Flowering)
FloweringSummary <- array( dim = c(3, 4))
FloweringTab <- cbind( Flowering[, 1:2],
Change = Flowering[, 2] - Flowering[, 1])
rownames(FloweringSummary) <- c("Willow (encroaching)",
"Skypilot (native)",
"Differences")
colnames(FloweringSummary) <- c("Mean",
"Standard deviation",
"Standard error",
"Sample size")
FloweringSummary[, 1] <- colMeans(FloweringTab,
na.rm = TRUE)
FloweringSummary[, 2] <- apply(FloweringTab,
2,
"sd",
na.rm = TRUE)
FloweringSummary[, 3] <- apply(FloweringTab,
2,
"findStdError",
na.rm = TRUE)
FloweringSummary[, 4] <- apply(FloweringTab,
2,
"realLength")
# Do some appropriate rounding
FloweringSummary <- round(FloweringSummary, 4)
FloweringSummary[1:2, 1] <- round(FloweringSummary[1:2, 1], 3)
if( knitr::is_latex_output() ) {
knitr::kable(pad(FloweringSummary,
surroundMaths = TRUE,
targetLength = c(6, 6, 5, 0),
decDigits = c(2, 3, 3, 0)),
format = "latex",
align = "c",
linesep = "",
caption = "The day of first flowering for encroaching willow and native skypilot.",
col.names = c("Mean", "Standard deviation", "Standard error", "Sample size"),
row.names = TRUE,
escape = FALSE,
booktabs = TRUE) %>%
row_spec(0, bold = TRUE) %>%
row_spec(3, italic = TRUE) %>%
row_spec(2, hline_after = TRUE) %>%
kable_styling(font_size = 8)
}
if( knitr::is_html_output() ) {
kable( pad(FloweringSummary,
surroundMaths = TRUE,
targetLength = c(6, 6, 5, 0),
decDigits = c(2, 3, 3, 0)),
format = "html",
align = "c",
booktabs = TRUE,
longtable = FALSE,
col.names = c("Mean", "Standard deviation", "Standard error", "Sample size"),
caption = "The day of first flowering for encroaching willow and native skypilot.") %>%
row_spec(0, bold = TRUE)
}
```
The standard error of the mean difference is $\text{s.e.}(\bar{d}) = 0.9396$ (Fig.\ \@ref(fig:FloweringjamoviHT) or Table\ \@ref(tab:FloweringSummaryHT)).
The sampling distribution for $\bar{d}$ has a normal distribution, centred around $\mu_d$ with a standard deviation of $\text{s.e.}(\bar{d}) = 0.9396$.
The approximate $95$%\ CI for the mean difference is
$$
1.36 \pm ( 2\times 0.9396),
$$
or from $-0.519$ to\ $3.24$\ days.
The exact $95$% CI (Fig.\ \@ref(fig:FloweringjamoviHT)) is $-0.579$ to\ $3.30$\ days; the difference is because the approximate CI uses the *approximate* multiplier of\ $2$ from the $68$--$95$--$99.7$ rule.
The value of the test statistic (i.e., the $t$-score) is
\begin{align*}
t
= \frac{\bar{d} - \mu_d}{\text{s.e.}(\bar{d})}
= \frac{1.36 - 0}{0.9396} = 1.45,
\end{align*}
as in the output.
This is a relatively small value of\ $t$, so a large $P$-value is expected using the $68$--$95$--$99.7$ rule.
Indeed, the output shows that $P = 0.161$: 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 $\mu_d = 0$).
Since *positive* differences mean willow flowers earlier, we write (using the exact CI):
> No evidence exists ($t = 1.45$; two-tailed $P = 0.161$) that the day of first-flowering is different for the encroaching willow and the native skypilot (mean difference: $1.36$ days earlier for willow; approximate $95$%\ CI between $0.52$\ days earlier for skypilot to $3.24$\ days earlier for willow; $n = 25$).
The CI is statistically valid since $n = 25$.
::: {.importantBox .important data-latex="{iconmonstr-warning-8-240.png}"}
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.
:::
:::: {.importantBox .important data-latex="{iconmonstr-warning-8-240.png}"}
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).
:::
## Example: chamomile tea {#ChamomileTea-Paired}
@rafraf2015effectiveness studied patients with Type\ 2 diabetes mellitus (T2DM).
They randomly allocated $32$\ patients into a control group (who drank hot water), and another $32$\ patients to receive chamomile tea (p.\ 164):\index{Control}\index{Blinding!researchers}
> The study was blinded so that the allocation of the intervention or control group was concealed from the researchers and statistician [...]
> The intervention group ($n = 32$) consumed one cup of chamomile tea [...] three times a day immediately after meals (breakfast, lunch, and dinner) for $8$\ weeks.
> The control group ($n = 32$) consumed an equivalent volume of warm water during the $8$-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\ \@ref(tab:TGsummaryTable)).
(ref:TGsummary) The total glucose (TG; in mg.dl$^{-1}$) for two groups: those who drank chamomile tea, and those who drank hot water (the control group). The **Reduction** columns summarise the reduction in TG for each group.