TGViewer
Data science/ML/AI Data science/ML/AI @datascience_bds · 14.1K subscribers
Post #1184 1.74K
⚖️ Hypothesis Testing & P-values 🧑‍⚖️📊

You've run an A/B test. Your new website design (Version B) got 12% more clicks than the old one (Version A). Great, right? But is that 12% a real improvement, or just a lucky fluctuation in your data?

This is where Hypothesis Testing and the notorious P-value come in. They help you decide if your observed data is significant enough to make a big decision, or if it's just random chance.


🏛 The Courtroom Scenario

Imagine a trial:
• Default Assumption (Null Hypothesis, H0): The defendant is NOT GUILTY. (Our designs are the same, the 12% is luck.)
• What We're Trying to Prove (Alternative Hypothesis, H1): The defendant IS GUILTY. (Version B is better than A.)
• The Evidence (Your Data): The 12% difference in clicks.
• The Judge's Decision (P-value): How likely is it that we'd see this "evidence" (12% difference) if the defendant were truly not guilty (designs truly the same)?


1. The Null (H0) & Alternative (H1) Hypotheses

• Null Hypothesis (H0): There is no significant difference between the two groups/variables. (e.g., "New design has no effect on clicks." or "Mean sales for region X is 100.")
• Alternative Hypothesis (H1): There is a significant difference or relationship. (e.g., "New design increases clicks." or "Mean sales for region X is not 100.")

Our goal is usually to reject H0 in favor of H1.


2. The P-value: What It Actually Means

The P-value is the probability of observing data as extreme as (or more extreme than) your current data, assuming the Null Hypothesis is true.

• Small P-value (e.g., 0.01): "It's highly unlikely we'd see this much difference if the new design had no effect. So, we'll reject the null and conclude the new design is better."
• Large P-value (e.g., 0.60): "There's a good chance we'd see this difference just by luck, even if the new design had no real effect. So, we fail to reject the null."


3. The Significance Level (Alpha, α)

This is your cutoff point. Most commonly, α = 0.05 (5%).
• P-value ≤ α: Reject the Null Hypothesis. (Your result is "statistically significant.")
• P-value > α: Fail to Reject the Null Hypothesis. (Your result is not statistically significant.)


4. The Biggest Misconceptions (DON'T DO THIS!)

• P-value is NOT the probability that H0 is true.
• P-value is NOT the probability that H1 is false.
• A "significant" P-value doesn't mean the effect is large or important in the real world. (A tiny, unimportant difference can be statistically significant if you have a huge dataset.)


🎯 Today's Goal(What you should do)
✔️ Formulate clear Null and Alternative Hypotheses.
✔️ Understand the P-value as the likelihood of seeing your data if the Null were true.
✔️ Use a significance level (alpha) to make decisions.
✔️ AVOID common P-value misinterpretations!

👉 P-values don't tell you if your hypothesis is true, but they do tell you if your data makes the Null Hypothesis look very, very unlikely.
  • ❤ 3
  • 👏 3
  • 👍 1
More from @datascience_bds
  1. Oct 11, 2026🧮 Why does NumPy let you add a number to an entire matrix? Look at this: import numpy as…
  2. Oct 10, 2026document post
  3. Oct 9, 20268 RAG architectures for AI Engineers, visually explained:
  4. Oct 8, 2026document post
  5. Oct 7, 2026🧮 NumPy: Why axis=0 and axis=1 Feel Backwards You've probably seen: np.mean(X, axis=0) an…
  6. Oct 6, 2026document post
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →