# Does a paired t-test compare means?

The reason I ask is that I keep reading it compares means, yet everywhere people keep using box-plots for visualization, which seems fishy to me.

In more detail I would like to know whether information of the 2 sample means is enough to unambiguously know the "direction"* of a paired t-test p-value?

Are there any theoretical scenarios where looking just at the 2 means would be misleading? (Like many close pairs and a pair with infinite difference..)

*direction: I am lacking the jargon but for example the "direction" of a sign-test points to the group which has more "+". A U-test points to the direction of higher intra-sample mean of inter-sample-ranks and a 'normal' t-test_ind points to the direction of higher mean.

EDIT: Here is the first google-picture result to "paired t-test visualization": But obviously I know that a boxplot of the differences would be ok!

• A paired t-test in a one-sample test. Do you mean a two-sample t-test? – Dave Jul 3 '20 at 14:56
• Yea, I basically mean a 1 sample t-test comparing the differences of 2 distribution before and after treatment to 0. Thereby it reduces variance caused by individual samples. – KaPy3141 Jul 3 '20 at 15:06
• Could you please post an example of where you’ve seen the paired test visualized with box plots? – Dave Jul 3 '20 at 15:09
• I just added an example as an edit. – KaPy3141 Jul 3 '20 at 15:32
• That's not right: a one-sample t-test evaluates whether the data are consistent with the true mean being equal to a hypothesized value. It does not compare two distributions. The purpose of showing boxplots is to provide information beyond that presented by the t-test: there's nothing "fishy" about this. – whuber Jul 3 '20 at 16:05

The boxplot gives you a flavour of the two distributions. Often wrong statistical modelling (mistakes in the estimated significance, for instance) can be identified by looking at the plotted distributions. It's easier to understand something visually than by abstract concepts like numbers.

One case where a plot (typically a violin plot) may be informative is when the distributions are complex (bimodal for instance). The plot gives an immediate sense of what's going on with the data. That would tell you if the statistical test assumptions are violated or not. For this reason, many journals require not only the boxplots (or violin plots) but also the individual points (when the number is not too large).

A paired t-test is equivalent to a t-test for the difference with null of 0:

You can easily check if with the following code:

x = rnorm(100, mean=0, sd=1)
y = rnorm(100, mean=5, sd=1)


Paired t-test:

t.test(x,y, paired = T)


gives:

Paired t-test

data:  x and y
t = -34.659, df = 99, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-5.297422 -4.723708
sample estimates:
mean of the differences
-5.010565


T-test against 0:

t.test(x-y)


gives:

    One Sample t-test

data:  x - y
t = -34.659, df = 99, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
-5.297422 -4.723708
sample estimates:
mean of x
-5.010565