# why the lower.tail=F is used when mannualy calculating the p value from t score

I was searching on this forum to calculate the p value from a t.test score.
So I found this topic.

> 2*pt(ttestscore, lower=FALSE)


However it makes no sense to me using the lower = FALSE. When using the lower = F argument you will calculate the probability of the black shaded area in the second figure right?

This means that you are calculating the probability that the t score is LESS then the giving t score, but you want to calculate the probability that the T score is bigger (if you are giving the t score as a positive number)?

• The argument is lower.tail and if set to FALSE the function gives the upper tail probability just as you'd expect and as the documentation says. Type ?pt in the R console. – dsaxton Oct 4 '16 at 17:43
• You may find vonjd's answer in that thread relevant. In particular consider these two (equivalent) alternative versions, the first being his code: 1:... p.value = 2*pt(-abs(t.value), df=length(data)-1) ... $\qquad\quad\:\:$ 2: ... p.value = 2*pt(abs(t.value), df=length(data)-1,lower.tail=FALSE) – Glen_b Oct 4 '16 at 22:23

Check out the documentation for R's pt() function.

lower.tail
logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].*

In other words, when lower.tail=FALSE you get the probability to the right of X (the first of your two diagrams).

Or just run it for yourself:

> pt(2,10)
 0.963306
> pt(2,10,lower.tail = FALSE)
 0.03669402


Student t distribution is symmetric. So if you calculate the area under upper tail and multiply it by 2, you end up with the 2 tailed p-value of your test score.