Back

How to Find P Value in Statistics (With Examples)

How to Find P Value

In statistics, few concepts carry as much weight in decision-making as the p value. Whether you are conducting a clinical trial, analyzing survey data, or testing a business hypothesis, the p value tells you something fundamental: how likely your results are if there were actually nothing going on — no effect, no difference, no relationship.

Yet despite its widespread use, the p value remains one of the most misunderstood figures in data analysis. Many researchers report it without fully grasping what it measures, leading to conclusions that don’t hold up to scrutiny.

Too busy working, parenting, or surviving?

Focus on life; we’ll focus on your paper

What Is a P Value?

A p value is a probability — specifically, the probability of obtaining results at least as extreme as the ones you observed, assuming the null hypothesis is true.

That definition is precise, but it helps to unpack it. In any statistical test, you start with a null hypothesis: a default assumption that there is no effect, no difference, or no relationship in the data. The p value then answers a pointed question — if that null hypothesis were true, how often would chance alone produce results like yours?

The answer comes as a number between 0 and 1. A p value of 0.03, for example, means there is a 3% probability of seeing results this extreme by random chance, under the assumption that the null hypothesis holds. The smaller the p value, the harder it becomes to explain your results as coincidence.

It is worth being clear about what a p value is not. It does not measure the probability that the null hypothesis is true. It does not tell you the size or practical importance of an effect. And it does not, on its own, prove anything. It is one piece of evidence — a signal that helps you decide whether your data are worth taking seriously.

Most researchers compare the p value against a predetermined threshold called the significance level, commonly set at 0.05. When the p value falls below this threshold, the result is described as statistically significant, meaning the data are unlikely enough under the null hypothesis to warrant further attention.

P Value vs Significance Level (α)

The p value and the significance level are two distinct things that work together to drive a statistical decision. Confusing them is one of the most common mistakes in data analysis.

The significance level, written as α (alpha), is a threshold you set before running your test. It represents the maximum probability of a false positive you are willing to accept — that is, the risk of rejecting the null hypothesis when it is actually true. In most fields, α is set at 0.05, meaning researchers tolerate a 5% chance of flagging a non-existent effect as real. Some fields demand stricter standards; particle physics, for instance, uses α = 0.000003, while medical research often applies 0.01.

The p value, by contrast, is calculated after collecting your data. It is what the test produces. Once you have it, the decision rule is straightforward: if the p value is less than α, you reject the null hypothesis and call the result statistically significant. If the p value is greater than or equal to α, you fail to reject the null hypothesis.

One phrase deserves particular attention: “fail to reject.” This is not the same as proving the null hypothesis true. A high p value simply means your data did not provide strong enough evidence against it — absence of evidence is not evidence of absence.

Think of α as the bar you set in advance, and the p value as the score your data earns. The result is significant only when the score clears the bar.

When Do You Use a P Value?

Core Purpose

You use a p-value when you’re conducting a hypothesis test to determine if there is statistically significant evidence against a null hypothesis (usually the assumption of “no effect” or “no difference”).

Common Scenarios

SituationExample
Comparing groupsDoes Drug A lower blood pressure more than a placebo?
Testing relationshipsIs there a correlation between study hours and exam scores?
Checking model fitDoes adding this variable improve my regression model?
A/B testingDoes Version B of a website generate more clicks than Version A?
Quality controlIs this batch of products outside acceptable specifications?

How to Interpret It

  • Small p-value (typically ≤ 0.05): The result is statistically significant. You reject the null hypothesis. The observed effect is unlikely to be due to random chance alone.
  • Large p-value (> 0.05): The result is not statistically significant. You fail to reject the null hypothesis. You don’t have enough evidence to say the effect is real.

Important Caveats

What a p-value tells youWhat it does NOT tell you
How compatible your data is with the null hypothesisThe probability that your hypothesis is true
Whether the result is due to chanceThe size or importance of the effect
If you should reject the null hypothesisWhether your finding is practically meaningful

Practical Example

You test whether a new teaching method improves test scores. The p-value is 0.03.

Interpretation: If the teaching method actually had no effect, you’d only see this much improvement (or more) about 3% of the time by random chance. Since 0.03 < 0.05, you conclude the improvement is statistically significant.

Formula for P Value

There is no single formula for a p value. Instead, the p value is derived from a test statistic, and the formula for that test statistic depends on the type of test you are running. Once you calculate the test statistic, you compare it against its corresponding probability distribution to obtain the p value.

The general process follows this structure:

1. Calculate the test statistic

Each hypothesis test has its own formula for converting raw data into a test statistic. The test statistic measures how far your observed results sit from what the null hypothesis would predict, expressed in standardized units. Three of the most common are:

Z-statistic (used when the population standard deviation is known and the sample is large):Z=xˉμ0σ/nZ = \frac{\bar{x} – \mu_0}{\sigma / \sqrt{n}}

Where xˉ\bar{x}xˉ is the sample mean, μ0\mu_0μ0​ is the hypothesized population mean, σ\sigmaσ is the population standard deviation, and nnn is the sample size.

T-statistic (used when the population standard deviation is unknown):t=xˉμ0s/nt = \frac{\bar{x} – \mu_0}{s / \sqrt{n}}

Where sss is the sample standard deviation in place of σ\sigmaσ.

Chi-square statistic (used for categorical data):χ2=(OE)2E\chi^2 = \sum \frac{(O – E)^2}{E}

Where OOO is the observed frequency and EEE is the expected frequency for each category.

2. Find the p value from the distribution

Once you have the test statistic, the p value is the probability of observing a value that extreme or more extreme under the null hypothesis. For a z-test, this means looking up the area in the tail of the standard normal distribution. For a t-test, you consult the t-distribution with the appropriate degrees of freedom. For a chi-square test, you use the chi-square distribution.

In practice, this step is handled by statistical software or a p value table — you rarely compute the tail probability by hand.

3. The direction of the test matters

For a one-tailed test, the p value is the area in one tail of the distribution — the side predicted by your hypothesis. For a two-tailed test, you double the one-tail area, because an extreme result in either direction counts as evidence against the null hypothesis.

The formula, in every case, is a means to an end. What you are ultimately producing is a probability — one that tells you how compatible your data are with the world the null hypothesis describes.

How to Find P Value Step-by-Step

Finding a p value follows a consistent sequence regardless of which test you are running. Work through these steps in order, and the process becomes repeatable across any hypothesis test.

Step 1: State your hypotheses

Begin by defining two competing statements. The null hypothesis (H₀) claims there is no effect, no difference, or no relationship. The alternative hypothesis (H₁) claims there is. Be specific — your hypotheses should reference the exact population parameter you are testing, such as a mean, proportion, or variance.

For example:

  • H₀: The mean recovery time for patients on the new drug equals that of patients on the placebo (μ₁ = μ₂)
  • H₁: The mean recovery time for patients on the new drug differs from that of patients on the placebo (μ₁ ≠ μ₂)

Step 2: Set your significance level

Choose your threshold α before looking at the data. This prevents you from adjusting your standard after seeing results. The most common choice is α = 0.05, but your field or the stakes involved may call for something stricter.

Step 3: Select the appropriate test

Match your test to your data type and study design. Key questions to ask:

  • Are you comparing means, proportions, or frequencies?
  • How many groups are involved?
  • Is the population standard deviation known or unknown?
  • Are your samples independent or paired?

A one-sample t-test, two-sample t-test, paired t-test, chi-square test, ANOVA, and z-test each suit different scenarios. Choosing the wrong test produces a p value that cannot be trusted.

Step 4: Check your assumptions

Every test rests on assumptions. The t-test assumes approximate normality and independence. The chi-square test requires expected frequencies of at least 5 in each cell. Running a test on data that violate its assumptions can distort the p value significantly. If your data do not meet the assumptions of a parametric test, consider a non-parametric alternative.

Step 5: Calculate the test statistic

Apply the formula for your chosen test using your sample data. This converts your raw observations into a single standardized number that measures how far your results sit from the null hypothesis expectation. The larger the absolute value of the test statistic, the further your data are from what the null hypothesis predicts.

Step 6: Find the p value

Use the test statistic and its corresponding distribution to find the p value. In practice, statistical software such as R, Python, SPSS, or Excel handles this automatically. If working by hand, use a probability table for the relevant distribution — z, t, chi-square, or F — and look up the tail area corresponding to your test statistic.

Remember to account for the direction of your test:

  • One-tailed test: use the area in one tail only
  • Two-tailed test: double the one-tail area

Step 7: Compare the p value to α and draw a conclusion

If p < α, reject the null hypothesis. The result is statistically significant — your data are unlikely under the null hypothesis, and the alternative hypothesis gains support.

If p ≥ α, fail to reject the null hypothesis. The data do not provide sufficient evidence to rule out chance as an explanation.

State your conclusion in plain terms tied to the original research question. A statistical decision is only useful when it connects back to the real-world problem you set out to investigate.

Between job, family, and classes

Let our team handle the writing while you recover your time

How to Find P Value Using a Z-Score

A z-score converts your sample result into a standardized value that tells you how many standard deviations it sits from the mean predicted by the null hypothesis. From that standardized value, you can extract a p value using the standard normal distribution.

This approach applies when your sample size is large (generally n ≥ 30), the population standard deviation σ is known, and the data are approximately normally distributed.

The formulaZ=xˉμ0σ/nZ = \frac{\bar{x} – \mu_0}{\sigma / \sqrt{n}}

Where:

  • xˉ\bar{x}xˉ is the sample mean
  • μ0\mu_0μ0​ is the population mean stated in the null hypothesis
  • σ\sigmaσ is the known population standard deviation
  • nnn is the sample size

Step-by-step: from z-score to p value

Once you have computed Z, the p value is the probability of observing a z-score at least as extreme as yours, assuming the null hypothesis is true. You extract this from the standard normal distribution.

For a left-tailed test (H₁: μ < μ₀):p=P(Zz)=Φ(z)p = P(Z \leq z) = \Phi(z)

The p value is the area to the left of your z-score in the standard normal curve.

For a right-tailed test (H₁: μ > μ₀):p=P(Zz)=1Φ(z)p = P(Z \geq z) = 1 – \Phi(z)

The p value is the area to the right of your z-score.

For a two-tailed test (H₁: μ ≠ μ₀):p=2×P(Zz)=2(1Φ(z))p = 2 \times P(Z \geq |z|) = 2(1 – \Phi(|z|))

You double the one-tail area because an extreme result in either direction counts as evidence against the null hypothesis.

Worked example

A bottling plant claims its machines fill bottles to a mean of 500ml. The population standard deviation is known to be 8ml. A quality inspector randomly samples 40 bottles and finds a sample mean of 503ml. Does the evidence suggest the machine is overfilling?

State the hypotheses:

  • H₀: μ = 500
  • H₁: μ > 500 (right-tailed test)

Set significance level: α = 0.05

Calculate the z-score:Z=5035008/40=31.2652.37Z = \frac{503 – 500}{8 / \sqrt{40}} = \frac{3}{1.265} \approx 2.37

Find the p value:

For a right-tailed test, the p value is the area to the right of Z = 2.37 in the standard normal distribution.

p=1Φ(2.37)10.9911=0.0089p = 1 – \Phi(2.37) \approx 1 – 0.9911 = 0.0089

Draw a conclusion:

Since p = 0.0089 < α = 0.05, reject the null hypothesis. The evidence suggests the machine is overfilling at a statistically significant level.

Using a z-table

If you are working without software, a standard normal table (z-table) lists the cumulative area to the left of any z-score. For a right-tailed test, subtract the table value from 1. For a two-tailed test, subtract from 1 and then double the result. Most z-tables cover values from −3.4 to +3.4, which handles the vast majority of practical cases.

For z-scores beyond ±3, the p value is extremely small — typically below 0.001 — and the null hypothesis can almost certainly be rejected at any conventional significance level.

How to Find P Value Using a T-Score

The t-test is the most widely used hypothesis test in practice. It applies when the population standard deviation is unknown — which describes the majority of real-world research situations — and must be estimated from the sample itself. The resulting test statistic follows a t-distribution rather than the standard normal distribution, and the shape of that distribution depends on the degrees of freedom.

This approach is appropriate when your data are approximately normally distributed, observations are independent, and you are working with a single sample, two independent samples, or paired observations.

The formula

For a one-sample t-test:t=xˉμ0s/nt = \frac{\bar{x} – \mu_0}{s / \sqrt{n}}

Where:

  • xˉ\bar{x}xˉ is the sample mean
  • μ0\mu_0μ0​ is the population mean stated in the null hypothesis
  • sss is the sample standard deviation
  • nnn is the sample size

The degrees of freedom for a one-sample t-test are:df=n1df = n – 1

From t-score to p value

Once you have the t-statistic and degrees of freedom, the p value is found from the t-distribution — the probability of observing a t-value at least as extreme as yours, assuming the null hypothesis is true.

For a left-tailed test (H₁: μ < μ₀):p=P(Tt)p = P(T \leq t)

The p value is the area to the left of your t-score.

For a right-tailed test (H₁: μ > μ₀):p=P(Tt)=1P(Tt)p = P(T \geq t) = 1 – P(T \leq t)

The p value is the area to the right of your t-score.

For a two-tailed test (H₁: μ ≠ μ₀):p=2×P(Tt)p = 2 \times P(T \geq |t|)

Double the one-tail area to account for both directions.

Worked example

A nutritionist claims that a new meal plan reduces daily calorie intake to below 2,000 calories on average. She recruits 15 participants and records their daily intake over one month. The sample produces a mean of 1,924 calories and a standard deviation of 210 calories. Is there sufficient evidence to support her claim?

State the hypotheses:

  • H₀: μ = 2,000
  • H₁: μ < 2,000 (left-tailed test)

Set significance level: α = 0.05

Calculate the t-statistic:t=19242000210/15=7654.231.40t = \frac{1924 – 2000}{210 / \sqrt{15}} = \frac{-76}{54.23} \approx -1.40

Determine degrees of freedom:df=151=14df = 15 – 1 = 14

Find the p value:

For a left-tailed test with t = −1.40 and df = 14, consult a t-table or statistical software.p0.091p \approx 0.091

Draw a conclusion:

Since p = 0.091 > α = 0.05, fail to reject the null hypothesis. The data do not provide sufficient evidence at the 5% significance level to conclude that the meal plan reduces average daily intake below 2,000 calories.

Using a t-table

A t-table lists critical values of the t-distribution for common significance levels and degrees of freedom. To use it manually, locate the row corresponding to your degrees of freedom and scan across to find where your t-statistic falls relative to the listed critical values. This gives you a range for the p value rather than an exact figure — for example, 0.05 < p < 0.10 — which is often sufficient to make a decision.

For precise p values, statistical software is the practical choice. Functions such as T.DIST in Excel, pt() in R, and scipy.stats.ttest_1samp() in Python return exact results directly.

How the t-distribution differs from the normal distribution

The t-distribution is shorter and wider than the standard normal curve, with heavier tails. This reflects the additional uncertainty introduced by estimating σ from the sample. As degrees of freedom increase — that is, as sample size grows — the t-distribution converges toward the standard normal distribution. At around df = 30 and above, the two distributions are nearly indistinguishable, which is why large samples allow the z-test to serve as a reasonable approximation even when σ is unknown.

Assignments piling up?

We’ll clear your plate

How to Find P Value Without a Table

Statistical tables were once the only option for converting a test statistic into a p value. Today, they are rarely necessary. A range of software tools and online calculators can produce exact p values in seconds, with no table-reading or manual interpolation required.

Statistical Software

For researchers and analysts working with full datasets, statistical software computes the p value as part of the test output automatically.

R (Free) R is one of the most widely used environments for statistical computing. Built-in functions handle the most common tests directly:

r

# One-sample t-test
t.test(x, mu = 100)

# Two-sample t-test
t.test(x, y)

# Z-test (using BSDA package)
z.test(x, sigma.x = 15, mu = 100)

# Chi-square test
chisq.test(table)

Each function returns the test statistic, degrees of freedom, and p value in a single output. Download R at r-project.org.

Python (Free) The scipy.stats library covers virtually every common hypothesis test:

python

from scipy import stats

# One-sample t-test
stats.ttest_1samp(data, popmean=100)

# Two-sample t-test
stats.ttest_ind(group1, group2)

# Z-test (using statsmodels)
from statsmodels.stats.weightstats import ztest
ztest(data, value=100)

# Chi-square test
stats.chisquare(observed, expected)

Python is available at python.org. The scipy library documentation lives at scipy.org/stats.

Microsoft Excel Excel includes built-in functions for finding p values without any additional installation:

=T.TEST(array1, array2, tails, type)      ' T-test p value
=Z.TEST(array, μ, σ)                      ' Z-test p value
=CHISQ.TEST(actual_range, expected_range) ' Chi-square p value

These functions return the p value directly. Excel is available at microsoft.com/excel.

SPSS SPSS is common in social science and medical research. It outputs p values — labeled “Sig.” in its results tables — for every test it runs. Information on SPSS is available at ibm.com/spss.

Online P Value Calculators

For quick calculations without writing any code or owning any software, online calculators are the fastest option. Enter your test statistic and degrees of freedom, and the p value is returned immediately.

Reliable options include:

One-Tailed vs Two-Tailed P Values

One-Tailed vs Two-Tailed P Values

Behind on assignments?

Catch up fast with expert help

FAQs

What does a p-value of 0.01 mean?

It means there is a 1% chance of observing the results (or more extreme) if the null hypothesis is true. This is strong evidence against the null hypothesis.

When to use 0.01 and 0.05 level of significance?

0.05 (5%) → Standard level, used in most studies
0.01 (1%) → Stricter level, used when you need stronger evidence (e.g., medical or high-risk decisions)

Does 0.05 mean 5%?

Yes. A significance level of 0.05 = 5%, meaning you accept a 5% risk of being wrong when rejecting the null hypothesis.

This website stores cookies on your computer. Cookie Policy