# Does a two sample t test compare the means which each other directly or not?

We calculate the t statistic (obtained), which "represents the number of standard deviation units (or standard error units) that our sample mean is from the hypothesized value of µY, assuming the null hypothesis is true" (Frankfort-Nachmias and Leon-Guerrero 2011:266).

Let's say we compare sample A with B, I first thought the t test would perform this by comparing the means like so: A <--> B. However after reading the above I looks like the t test compares them by A <--> population mean <--> B. So does it calculate the difference in standard error between the two samples by comparing the mean of A en B or by comparing the difference in standard error relative to the population mean?
*Please provide a detailed explanation I'm new in statistics

An independent two samples t-test compares the two sample means. You can see its statistic:

$$t = \frac{\bar {X}_1 - \bar{X}_2}{s_p \sqrt{2/n}}$$

Please notice the difference $\bar {X}_1 - \bar{X}_2$ in the formula: it tests difference of means of the two samples, but it doesn't use any global population mean.

A paired samples t-test also doesn't use population mean, because it uses means of differences of each pair of observations.

What you describe in the question when you compare each mean against an hypothesized population mean is one sample t-test (in fact, two one-sample t-test). That might be sometimes useful, but it isn't a way to check if the two samples come from populations with the same mean - that is, it isn't a tool to test difference of means.

If your are interested in comparing two samples, in the book you cited you should go to pages 272-280.

• A good answer. I think the OP got confused because of a very poor description in the highlighted reference. Dec 31, 2016 at 14:08
• @MichaelChernick After checking books.google.es/… , I think the confusion is between one-sample and two-sample t-test. I think the user just needs help to realize that there are several kinds of t-test, and that the one he found is not the one intended for what he wanted.
– Pere
Dec 31, 2016 at 14:14
• The highlighted reference is very confusing with its notation and inaccuracies. I think that also could be the problem. I looked at your link and all I could find was a social statistics in a language that is foreign to me. How does that connect with this question? Dec 31, 2016 at 17:21
• @MichaelChernick What reference do you mean? I just linked to the book the OP cited in the question - or at least I suppose it's the same book. There could be better books, but since he seems to be using this one I checked to see what he may be misunderstanding and pointed him to the right page to find what he is looking for.
– Pere
Dec 31, 2016 at 17:40