2026-03-08

What is a P-Value?

A p-value is a value used in hypothesis testing to show the degree to which the sample data supports the null hypothesis.

It is the probability of obtaining sample data as extreme as or more extreme than the sample data observed.

A p-value is a small number if the result would occur only in a small percentage of instances when the null hypothesis is true.

Hypothesis Testing

In statistics, we compare two hypotheses.

Null hypothesis:

\[H_0: \mu = \mu_0\]

Alternative hypothesis:

\[H_a: \mu \ne \mu_0\]

The p-value helps us decide whether we should reject the null hypothesis.

Mathematical Definition of P-Value

The p-value is defined as:

\[p\text{-value} = P(\text{data as extreme as observed} \mid H_0 \text{ is true})\]

This means we calculate the probability of observing the sample result, or something more extreme, assuming the null hypothesis is correct.

A very small p-value provides strong evidence against the null hypothesis.

Why P-Values Matter

Scientists use p-values to determine whether the findings from the sample are statistically significant.

If the p-value is small, the evidence against the null hypothesis is greater.

If the p-value is large, the evidence against the null hypothesis is not great, and we don’t reject the null hypothesis.

This makes the p-value a very important tool in statistical decision making.

Histogram Example

Scatterplot Example

Interactive Plotly Visualization

Example Interpretation

Suppose a researcher tests whether a new medicine improves recovery time.

If the p-value is 0.03, this means there is a 3 percent chance of getting results this extreme if the null hypothesis is true.

Because 0.03 is small, the researcher may reject the null hypothesis and conclude that the treatment likely has an effect.

R Code Example

ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point(color = "blue", size = 2) +
  geom_smooth(method = "lm", se = FALSE, color = "red") +
  labs(
    title = "Relationship Between Weight and MPG",
    x = "Weight",
    y = "Miles Per Gallon"
  ) +
  theme_minimal()

Conclusion

The concept of ‘p-value’ is very important when hypothesis testing is considered.

It can be used to measure the evidence against the null hypothesis.

If the ‘p-value’ is smaller, it shows that there is more evidence against the null hypothesis, while if the ‘p-value’ is larger, it shows that there is less evidence against the null hypothesis.

‘P-values’ can be used to make better statistical decisions based on data.