# What is my p-value?

Computes the p-value of a z, t, chi-square, or F test statistic for a left-, right-, or two-tailed test.

- Page: https://www.acalculator.org/statistics/p-value-calculator
- JSON spec: https://www.acalculator.org/statistics/p-value-calculator.json
- Version: 85c0c0caf283

## Default answer

Example with the default inputs (Distribution Z, Test type Two-tailed, Test statistic 1.96): The p-value is 0.049996 for a Z statistic of 1.96 (Two-tailed).

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| distribution | Distribution | The distribution of the test statistic: z (standard normal), Student’s t, chi-square, or F. |
| testType | Test type | Which tail counts as extreme: both, the left, or the right. |
| testStatistic | Test statistic | The value of the z, t, chi-square, or F statistic from your data. |
| degreesOfFreedom | Degrees of freedom | Degrees of freedom of the t or chi-square distribution, or the numerator degrees of freedom of F. |
| degreesOfFreedom2 | Denominator degrees of freedom | The second (denominator) degrees of freedom of the F distribution. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| pValue | P-value | The probability, if the null hypothesis is true, of a test statistic at least as extreme as yours. |
| left | Left tail, P(X ≤ statistic) | The probability of a statistic at or below yours. |
| right | Right tail, P(X ≥ statistic) | The probability of a statistic at or above yours. |

## Method

Left-tailed: P(X ≤ s); right-tailed: P(X ≥ s); two-tailed: 2 × the smaller of the two, at most 1, for the chosen distribution under the null hypothesis.

## Assumptions

- For chi-square and F, which are not symmetric, the two-tailed p-value doubles the smaller tail.
- Degrees of freedom may be fractional (for example Welch’s t-test), from 1 up to 100,000.
- Chi-square and F statistics cannot be negative.
- P-values are good to at least 9 significant digits (about 13 for most inputs; about 10 with degrees of freedom in the tens of thousands).

## Worked examples

1. distribution = z-score, testType = two-tailed, testStatistic = 1.96 gives pValue = 0.049996.
2. distribution = z-score, testType = left-tailed, testStatistic = -2.33 gives pValue = 0.009903. Source: NIST/SEMATECH e-Handbook 1.3.6.7.1.
3. distribution = t-score, testType = two-tailed, testStatistic = 2.228, degreesOfFreedom = 10 gives pValue = 0.050012. Source: NIST/SEMATECH e-Handbook 1.3.6.7.2 (t 0.975, 10 = 2.228).
4. distribution = t-score, testType = two-tailed, testStatistic = 1, degreesOfFreedom = 1 gives pValue = 0.5.
5. distribution = chi-square-score, testType = right-tailed, testStatistic = 18.307, degreesOfFreedom = 10 gives pValue = 0.050001. Source: NIST/SEMATECH e-Handbook 1.3.6.7.4 (18.307 at 0.05, 10 df).
6. distribution = f-score, testType = right-tailed, testStatistic = 4, degreesOfFreedom = 2, degreesOfFreedom2 = 10 gives pValue = 0.052922.
7. distribution = f-score, testType = right-tailed, testStatistic = 3.326, degreesOfFreedom = 5, degreesOfFreedom2 = 10 gives pValue = 0.049993. Source: NIST/SEMATECH e-Handbook 1.3.6.7.3 (F 0.95; 5, 10 = 3.326).

## FAQ

### What is a p-value?

A p-value is the probability of obtaining test results at least as extreme as the observed results, assuming that the null hypothesis is true. It measures the strength of evidence against the null hypothesis. A smaller p-value indicates stronger evidence against the null hypothesis.

### How do I interpret p-values?

P-values are typically compared to a significance level (α):

• p < 0.001: Very strong evidence against null hypothesis
• p < 0.01: Strong evidence against null hypothesis
• p < 0.05: Moderate evidence against null hypothesis
• p < 0.10: Weak evidence against null hypothesis
• p ≥ 0.10: Insufficient evidence to reject null hypothesis

### What are the different types of hypothesis tests?

There are three main types of hypothesis tests:

• **Left-tailed test**: Tests if a parameter is less than a specified value (H₁: parameter < value)
• **Right-tailed test**: Tests if a parameter is greater than a specified value (H₁: parameter > value)
• **Two-tailed test**: Tests if a parameter is different from a specified value (H₁: parameter ≠ value)

### What distributions does this calculator support?

This calculator supports four common statistical distributions:

• **Z-score**: Standard normal distribution N(0,1)
• **T-score**: Student's t-distribution (requires degrees of freedom)
• **Chi-square score**: Chi-square distribution (requires degrees of freedom)
• **F-score**: F-distribution (requires two degrees of freedom)

### When do I need degrees of freedom?

Degrees of freedom are required for:

• **T-distribution**: Always required (typically n-1 for sample mean tests)
• **Chi-square distribution**: Always required (depends on test type)
• **F-distribution**: Always requires two degrees of freedom
• **Z-distribution**: Not required (standard normal distribution)

### What is the difference between p-value and significance level?

The p-value is calculated from your data and represents the probability of observing your results under the null hypothesis. The significance level (α) is a threshold you choose before conducting the test (commonly 0.05, 0.01, or 0.10). You reject the null hypothesis if p-value ≤ α.

### Can p-values be negative?

No, p-values cannot be negative. P-values are probabilities and must be between 0 and 1. A p-value of 0 would indicate that the observed result is impossible under the null hypothesis, while a p-value of 1 would indicate that the observed result is exactly what would be expected under the null hypothesis.

### What does it mean if p-value = 0.05?

A p-value of exactly 0.05 means that there is a 5% chance of observing results at least as extreme as yours if the null hypothesis is true. At the α = 0.05 significance level, you would reject the null hypothesis. However, p = 0.05 is considered borderline significant and should be interpreted with caution.

### How do I choose the right significance level?

The choice of significance level depends on your field and the consequences of errors:

• **α = 0.01**: Very strict, used when false positives are costly
• **α = 0.05**: Standard in most fields, balances Type I and Type II errors
• **α = 0.10**: More lenient, used when false negatives are costly

Consider the practical implications of your decision when choosing α.

### What are Type I and Type II errors?

In hypothesis testing:

• **Type I error (α)**: Rejecting the null hypothesis when it's true (false positive)
• **Type II error (β)**: Failing to reject the null hypothesis when it's false (false negative)

The significance level α controls the probability of Type I error. The power of the test (1-β) is the probability of correctly rejecting a false null hypothesis.

### When should I use a one-tailed vs two-tailed test?

Use a **one-tailed test** when you have a specific directional hypothesis (e.g., 'the new drug is better than the old one'). Use a **two-tailed test** when you're testing for any difference (e.g., 'the new drug is different from the old one'). Two-tailed tests are more conservative and are often preferred unless you have strong theoretical reasons for a directional hypothesis.

### How accurate are the p-value calculations?

This calculator computes each tail of the cumulative distribution function from the incomplete gamma and beta functions, to at least 9 significant digits (about 13 for most inputs; with degrees of freedom in the tens of thousands the incomplete gamma and beta functions lose a few digits, down to about 10). It agrees with statistical software packages like R, SPSS, or SAS, and with printed tables to the places they show.

### What if my test statistic is very large or very small?

Very large or small test statistics typically result in very small p-values, indicating strong evidence against the null hypothesis. The calculator works out the small tail directly, so a p-value such as 0.0000001 keeps its precision. Below about 1e-300 it shows 0.
