$p$ value calculator for $t$ test with examples

## p-value of the test

p-value of the test is the probability that the test statistic under null hypothesis will take on values as extreme as or more extreme than the observed value of test statistic.

The smaller p-value of the test indicate strong evidence against the null hypothesis $H_0$.

In this tutorial we discuss about how to find the p-value of the t-test. The p-value of the t-test depends on the direction of the alternative hypothesis.

## p-Value of t test

If the test statistic $t$ has $t$ distribution with $n-1$ degrees of freedom, then the $p$-value of the test for testing

a. left-tailed hypothesis is $p$-value = $P(t_{n-1}\leq t)$.

b. right-tailed hypothesis is $p$-value = $P(t_{n-1}\geq t)$.

c. two-tailed hypothesis is $p$-value = $2P(t_{n-1}\geq |t|)$.

#### Interpretation from p-value

If the $p$-value of the test is less than or equal to the level of significance ($\alpha$) (i.e., $p \leq \alpha$), we reject the null hypothesis $H_0$ at $\alpha$ level of significance.

If the $p$-value of the test is greater than the level of significance ($\alpha$) (i.e., $p > \alpha$), we fail to reject the null hypothesis $H_0$ at $\alpha$ level of significance.

## $p$-value calculator for $t$-test

Use this calculator to calculate the p-value for t-test.

t-Test p Value Calculator | ||
---|---|---|

t-Test Statistic : ($t$) | ||

Degrees of Freedom : ($n$) | ||

Tail : | Left tailedRight tailedTwo tailed | |

Results |
||

p-value: | ||

## How to use p-value calculator for t-test?

Step 1 - Enter the value of $t$-test statistic.

Step 2 - Enter the degrees of freedom

Step 3 - Select the alternative hypothesis (i.e. Left-tailed / Right-tailed / Two-tailed)

Step 3 - Click on "Calculate" button to get the p-value.

## p-value for Left tailed t test Example 1

The one sample t-statistic for testing $H_0: \mu=453$ against $H_1:\mu< 453$ (left-tailed test) from a sample of $n=6$ observations has the value $-2.738$.

a. What is the degrees of freedom for $t$?

b. What is the $p$-value of the test?

c. Is the value of $t=-2.738$ is statistically significant at $\alpha=0.05$?

#### Solution

The hypothesis testing problem is

$H_0 : \mu = 453$ against $H_1 : \mu < 453$ ($\text{left-tailed}$).

a. The degrees if freedom for $t$ is $n-1= 6-1 =5$.

b. Because the alternative hypothesis is left-tailed, the $p$-value of the test is given by

` $$ \begin{aligned} p&=P(t_{n-1}\leq t)\\ &=P(t_{6-1}\leq -2.738)\\ &=P(t_{5}\leq -2.738)\\ &= 0.0204 \end{aligned} $$ `

c. Because the p-value ($0.0204$) is $\text{less than}$ the significance level $\alpha = 0.05$, we $\text{reject}$ the null hypothesis at $0.05$ level of significance. The value of $t=-2.738$ is $\text{statistically significant}$ at $\alpha = 0.05$ level of significance.

## p-value for Right tailed t test Example 2

Find the p-value for a right-tailed hypothesis test for a sample size with a test statistic of $t=2.571$ from a sample of $n=10$ observations. If the level of significance is $\alpha = 0.05$, decide whether to reject $H_0$.

#### Solution

The sample size is $n = 10$. So the degrees of freedom is $df =9$.

The test statistic is $t_{obs} = 2.571$. The level of significance is $\alpha = 0.05$.

Because the alternative hypothesis is left-tailed, the $p$-value of the test is given by

` $$ \begin{aligned} p&=P(t_{n-1}\geq t)\\ &=P(t_{10-1}\geq 2.571)\\ &=P(t_{9}\geq 2.571)\\ &= 0.025 \end{aligned} $$ `

Because the p-value of the test ($0.025$) is less than the level of significance ($\alpha= 0.05$), we reject the null hypothesis at $0.05$ level of significance.

## p-value for two tailed t test Example 3

Find the p-value for a two tailed hypothesis test for a sample size with a test statistic of $t=2.671$ from a sample of $n=15$ observations. If the level of significance is $\alpha = 0.05$, decide whether to reject $H_0$.

#### Solution

The sample size is $n = 15$. So the degrees of freedom is $df =14$.

The test statistic is $t_{obs} = 2.671$. The level of significance is $\alpha = 0.05$.

Because the alternative hypothesis is left-tailed, the $p$-value of the test is given by

` $$ \begin{aligned} p&=2*P(t_{n-1}\geq |t|)\\ &=2*P(t_{15-1}\geq |2.671|)\\ &=2* 0.0091\\ &= 0.0182 \end{aligned} $$ `

Because the p-value of the test ($0.0182$) is less than the level of significance ($\alpha= 0.05$), we reject the null hypothesis at $0.05$ level of significance.

## Some $t$-tests calculators

Here you will find some easy to use statistics calculators with illustrated examples on $t$-tests.

- $t$-test for single mean
- $t$-test for two means with unequal variances (independent samples)
- $t$-test for two means with equal variances (independent samples)
- $t$-test for two means for dependent sample (paired t-test)
- $t$-test for testing correlation coefficient

## Endnote

In this tutorial, you learned about how to find the p-value for t-test. You also learned about how to solve numerical problems based on p-value for t-test.

To learn more about other parametric hypothesis testing, please refer to the following tutorials:

Let me know in the comments if you have any questions on **p-value calculator for t-test** and your thought on this article.