4.9.20 · HinglishProbability Theory & Statistics

Hypothesis testing — null - alternative, test statistic, p-value, errors (Type I & II)

1,806 words8 min readRead in English

4.9.20 · Maths › Probability Theory & Statistics


Hypothesis testing exist kyun karta hai?

Hamare paas ek sample hai, lekin hum poori population ke baare mein ek decision lena chahte hain. Sample noisy hota hai: chahe kuch bhi special na ho raha ho, random fluctuation patterns produce kar deta hai. Isliye humein ek disciplined rule chahiye jo control kare ki hum kitni baar randomness se fool ho jaate hain. Hypothesis testing exactly wahi rule hai.

Test statistic kya hota hai? Ek akela number jo data se compute hota hai aur measure karta hai ki sample ki prediction se kitna door hai, standard error ke units mein measured taaki hum iske random distribution ko jaanein.


z-test statistic ko first principles se derive kaise karein

Hum test karna chahte hain, sample mean use karke, observations se, aur known population SD ke saath.

Step 1 — ki distribution. Har ka mean aur variance hai. Sample mean hai .

Yeh step kyun? Independent variables ke sum ka variance add hota hai; constant factor ke square se aata hai.

Step 2 — standard error. Toh ka spread hai . Kyun? SD variance ka square root hota hai.

Step 3 — ke under standardize karein. Maano sach hai, toh . Central Limit Theorem ke wajah se, approximately normal hai, isliye

Yeh step kyun? Assumed mean subtract karo, SE se divide karo → ek unit-free score jo bataata hai ki data se kitne standard errors door hai.


p-value: itna badly fool hone ki probability


Figure — Hypothesis testing — null - alternative, test statistic, p-value, errors (Type I & II)

Galat hone ke do tarike

Tradeoff kyun hoti hai: kam karna (reject karne mein stricter hona) critical cutoff ko aur door push kar deta hai, jisse true effects detect karna mushkil ho jaata hai → badhta hai. Dono ko shrink karne ka ek hi tarika hai — badhao (dono distributions ko narrow karta hai).


Worked Example 1 — z-test, two-tailed

Ek machine ko bottles ml mein fill karni chahiye, ml. Hum bottles sample karte hain, ml milta hai. pe test karo ki machine off hai ya nahi.

  • , . Two-tailed kyun? "Off" ka matlab hai ya too high ya too low.
  • . Kyun? .
  • . Kyun? Observed mean ko standardize karo.
  • . Double kyun? Dono tails "utni extreme" hain.
  • reject. Machine mis-calibrated hai.

Worked Example 2 — right-tailed t-test

Ek nayi teaching method claim karti hai ki scores purane mean se zyada honge. Sample: , , . pe test karo.

  • , . Right-tailed kyun? Claim sirf "higher" ki hai.
  • with . kyun, nahi? unknown hai.
  • Critical . Kyunki , reject: evidence hai ki method help karta hai.

Worked Example 3 — non-rejection interpret karna

Ex.2 jaisa hi lekin : fail to reject. Yeh wording kyun? Humne method ko useless prove nahi kiya; bas evidence nahi mila. Evidence ka absence ≠ absence ka evidence.



Recall Feynman: ek 12-saal ke bachche ko samjhao

Socho tumhe shak hai ki ek coin rigged hai. Tum maanke shuru karte ho ki yeh fair hai (woh null hai). Tum ise 100 baar flip karte ho aur 80 heads milte hain. Ab poochho: "Agar coin sach mein fair hota, toh pure luck se kitni baar aisa ek-taraf jhukaa result milta?" Agar jawaab hai "almost never" (tiny p-value), toh tum believe karna band kar dete ho ki yeh fair hai. Agar "eh, kabhi kabhi hota hai," toh tum shrug karte ho aur fair maante rehte ho — prove isliye nahi kiya, balki doubt karne ki koi achi wajah nahi mili. Type I error hai ek perfectly fair coin ke baare mein "rigged!" chillana. Type II error hai ek loaded coin ko fair kehna.


Active Recall

Equality kismein hoti hai, mein ya mein?
Null hypothesis mein.
p-value precisely define karo.
.
Significance level ke saath decision rule?
reject karo agar ; warna fail to reject.
test karne ke liye z-statistic derive karo.
ka mean hai, variance ke under; standardize karo: .
ki jagah kab use karte hain?
Jab population unknown ho aur sample se estimate karna pade; tab .
Type I error kya hai aur uski probability kya hai?
Sach ko reject karna (false alarm); probability .
Type II error kya hai aur uski probability kya hai?
False ko reject karne mein fail hona (miss); probability .
Statistical power define karo.
= false ko correctly reject karne ki probability.
Hum aur dono freely kyun nahi ghata sakte?
Stricter cutoff kam karta hai lekin badhata hai; sirf bada dono ko shrink karta hai.
se two-tailed p-value?
.
"Fail to reject" ko "accept" kyun nahi kehte?
Test mein power nahi hoti; evidence ka absence, absence ka evidence nahi hai.
Yahan prosecutor's fallacy kya hai?
(the p-value) ko se confuse karna.

Connections

  • Central Limit Theorem ki normal distribution justify karta hai.
  • Standard Error — har test statistic ka denominator.
  • Confidence Intervals — two-tailed tests ka dual (reject ⇔ CI ke bahar).
  • Normal Distribution aur Student t-distribution — reference distributions.
  • Bayesian Inference directly deta hai (jo p-values nahi dete).
  • Statistical Power & Sample Size control karna.

Concept Map

motivates

assumes true

seeks evidence for

shape decides

standardize under

computes

justifies normal

SE from

gives

too small rejects

controls chance of

Sample from population

Hypothesis testing

Null H0 equality no effect

Alternative H1 the claim

One or two tailed

Test statistic Z or T

Central Limit Theorem

Standard error sigma over sqrt n

p-value

Type I and Type II errors

Deep Dive