2025-10-16

Title

A GLIMPSE INTO P-VALUES

Understanding P-Values

A p-value measures how compatible your data is with the null hypothesis.

  • Small p-values suggest that data is unlikely if H₀ is true.
  • Large p-values suggest that data is consistent with H₀.

Hypothesis Testing Overview

Hypothesis testing compares two statements:

  • Null Hypothesis (H₀): No effect or no difference.
  • Alternative Hypothesis (H₁): There is an effect or difference.

The p-value helps in deciding if H₀ should be rejected.

P-Value Formula

The p-value is the probability of observing data at least as extreme as the sample data if the null is true:

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

Interpreting P-Values

  • p-value < α (e.g., 0.05) → reject H₀.
  • p-value ≥ α → fail to reject H₀.
  • A small p-value does not prove H₁ it just suggests that H₀ is unlikely.

For Example: Rolling a Die

  • H₀: Die is fair (P(6) = 1/6)
  • H₁: Here, Die is biased
  • Roll the die 60 times and count sixes.
## [1] 9

Calculating P-Value

  • Assume that die_rolls is defined from previous example
  • We use Binomial test to check if number of sixes is consistent with a fair die
## 
##  Exact binomial test
## 
## data:  sum(die_rolls) and length(die_rolls)
## number of successes = 9, number of trials = 60, p-value = 0.863
## alternative hypothesis: true probability of success is not equal to 0.1666667
## 95 percent confidence interval:
##  0.0709562 0.2657404
## sample estimates:
## probability of success 
##                   0.15

Histogram of Die Rolls

Simulate multiple die experiments

3D Plot – P-Value Sensitivity (Fair vs Biased Dice)

Key Takeaways

  • P-values measure how fascinating the data is under the null hypothesis.
  • They also guide hypothesis testing but don’t really confirm the alternative hypothesis.
  • Visualizations like histograms, boxplots, and interactive 3D plots help understand the p-value behavior.