# paired T test: how to plot it?

What is the best way to represent a paired T test comparison for a sample with N=200 and 5 variables (only one of which is important)? nonpaired T test is not significant.

A before-after graph is too dense (too many arrows).

A normal boxplot of the differences doesn't show any significance (maybe do I have to plot it with the mean confidence intervals?).

A boxplot of both variables (before and after) doesn't show the small but significant (5% differences) effect. Same happens with kernel density graphs.

Any suggestion?

• Because, by definition, a paired t test involves only two variables, please clarify what you are asking. Could you perhaps supply a small example of the data to illustrate?
– whuber
Sep 10, 2018 at 0:14

To me, a bivariate plot of the before/after for observations with a 1:1 line works well.

A histogram of the differences conveys the results as well.

Comment: Perhaps the $n = 200$ differences for the one important variable can be summarized as follows:

summary(d)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
-28.180  -2.112   4.113   3.589   9.993  29.806
sum(d > 0)
[1] 134


The mean and median are both about 4 > 0; 134 of the 200 observations are larger than 0. Let $\delta$ be the population difference, then $H_0: \delta = 0$ against $H_a: \delta \ne 0$ is rejected with a P-value < 0.0005.

A stripchart of the data shows values of each of the 200 differences (with a few not distinguishable at the resolution of this plot). Clearly, there are more positive differences than negative ones.

stripchart(d, pch="|")
abline(v = 0, col="green2")


• Thank you. I didn't know about the stripchart, I will definitely use it in the future.
– A-B
Sep 26, 2018 at 22:30

Late to the party but I wanted to add a more recent reference from 2017 to this thread for those like me who are looking for inspiration on how to graph paired data. The reference advocates the use of the hybrid parallel line plot for plotting such data.

The reference is as follows:

Graphic Portrayal of Studies With Paired Data: A Tutorial by David L. Schriger, MD, MPH