# p-value of a one-tailed test

This post is devoted to the calculation of the p-value of both left-tailed and right-tailed z-test. The basic definition of the p-value is in the post about the p-value of the two-tailed test.

## Left-tailed test

We will start with the left-tailed test and we will use the same assignment and number like in the previous post. The level of significance of the test $\alpha = 5 %$ and the value of the statistics is $Z = -1.9497$.

In case of the left-tailed z-test test, the p-value is the area under the probability density function from $- \infty$ to the value of the statistics, in our case to $-1.9497$.

The function which gives us the area under the curve for any value is the probability density function. We will use Microsoft Excel to get the p-value, more specifically, the function NORM.S.DIST (which we have used for the p-value of the two-tailed test). The only difference is that now we do not multiply the result by 2, so we write

=NORM.S.DIST(-1.9497,TRUE)

to get 0.0256 as a result. The value is lower than 0.05 which confirms our decision to reject the null hypothesis.

We also know that for any level of significance lower than 0.0256 (e.g. 0.01) the null hypothesis would not be rejected. This is the reason why we must always add the level of significance to the statement about rejection of the null hypothesis.

## Right-tailed test

We stay on the value of significance $\alpha = 5 %$ and the value of the statistics is $Z = - 0.2269$. It is not surprising that the p-value is now the area under the curve of the probability density function from the value of the statistics to $\infty$ (i.e. to the right). You can see it in the figure below.

Getting the exact value is little different now. The distribution function always measures the area to the left. We know that the total area under the curve equal to 1. So we get the “remaining” area by subtracting the value of the statistics from 1. In Microsoft Excel, we will use the formula

=1-NORM.S.DIST( -0.2269,TRUE)

to get the result 0.5897. The value is higher than $\alpha$ but it is also higher than 0.5. It makes sense because it contains the whole area from $0$ to $+ \infty$ (which is 0.5) plus something more.

If we did not extract the value of the distribution function from 1 then we would get “only” 0.4102 which is the “remaining” white area. So these figures may come handy in checking results of calculations.