I am doing a t-test and I am a little bit confused with x1 and x2:

enter image description here

For example: If the mean of dataset A is 1 and the mean of dataset B is 0.5, the t value is going to be negative or positive depending on which dataset I use as x1 and x2.

If x1 = 1 and x2 = 0.5 the t value is going to be positive.

If x1 = 0.5 and x2= 1 the t value will be negative.

I know that I am wrong with something, but I can't figure out what is it.


  • $\begingroup$ What is the question? $\endgroup$
    – Michael M
    Feb 17, 2016 at 16:20
  • $\begingroup$ How should I decide which is x1 and x2? depending on which I select the p-value of the t-test will be different $\endgroup$
    – Praderas
    Feb 17, 2016 at 16:21

2 Answers 2


While the sign of your obtained t value is going to change, the actual numbers will not. Your numerator is going to be either positive or negative 0.5.

If you look at the distribution of t scores, you will see that they are distributed around 0, and that you are testing both the positive and negative sides of the distribution simultaneously. So, it doesn't matter which of your means you place into which position as long as you are interested in finding out if there is a difference between the two means.

As the other answer points out, this is very different if you are running a one-tailed t-test. You need to have good theoretical justification for doing this, and you should have hypothesised this before collecting your data. In a one-tailed test you are predicting a particular relationship between your means (that mean 1 will be bigger/smaller than mean 2).

So, in a two-tailed test we are testing if there is a difference between mean 1 and mean 2. It could be that mean 1 is bigger than mean 2, or that it is smaller than mean 2. Going into the test, we don't have strong expectations about how the means will come out, we are just looking to see if they are different.

The one-tailed test assumes one of these two positions. For example, you may expect that mean 1 is going to be larger than mean 2, and want to test this specifically. Knowing that, on average, adult men are taller than adult women, you wish to test if boys are taller than girls at age 10. In this case, you could argue for a one-tailed test where mean 1 (boys) > mean 2 (girls).

One-tailed tests have an advantage in that it is easier to find significance. This is only true, however, if you're looking in the right tail. For example, comparing height at age 10, you are likely to find that girls are actually taller (estrogen has a stronger effect on height early on in puberty). If you were doing a one-tailed test looking for boys to be taller you might miss this significant difference.


In a two-sided setting, it does not play a role because only the absolute value of the $t$-statistic is used. In a one-sided setting, the sign of $t$ is crucial.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.