# How to calculate a p-vale from the t-distribution for a two-tailed t-test?

The resulting $$t$$ statistic from a t-test follows a t-distribution with parameter $$k =$$ freedom-degrees. For us to compute the probability of $$t$$ to occur, we use the cumulative distribution function of the t-distribution ($$CDF_t$$).

For a left-sided test, this is equal to finding the probability on the y-axis of the CDF, which intersects with the given $$t$$ value.

For a right-sided test, this is equal to 1 - the left-sided p-value.

What about the two-sided test? I am not sure how this p-value is computed using the CDF.

So far I have only seen this method: (from https://stackoverflow.com/questions/45045802/how-to-do-a-one-tail-pvalue-calculate-in-python)

$$p = CDF_t(t , df) * 2$$

i.e. the left-sided p-value multiplied by two.. which strikes me as odd, as the p-value ranges from 0 to 1, this equation generates a p-value in the domain [0-2].

For an easy way of understanding, the two sided $$p$$ value turns out to be equal to double the smallest one-sided $$p$$ value. Since these sum to 1, the smallest is in the domain [0-0.5], so the two sided is in the domain [0,1].