Foundations of Data Science 📂 Inferential Statistics · 7 of 8 146 min read

Test Statistics Explained: Z, T, and Chi-Square

A comprehensive, story-driven tutorial covering the three essential test statistics — Z, T, and Chi-Square. Includes the Guinness brewery origin of the t-test, four fully worked examples (water supply Z-test, sleep drug t-test, blood pressure paired t, biased dice χ², and city tea preference χ²), distribution diagrams, critical value tables, assumption checklists, and a decision map for choosing the right test.

🌐
SectionSection第 01 节

The Detective's Dilemma 🔍जासूस की दुविधा 🔍侦探的两难 🔍

Imagine you are a detective called to a scene. Your partner says: "Something strange happened here — I just don't know what." You search in every direction. That is a two-tailed test — open to surprises on either side.

मान लीजिए आप एक जासूस हैं जिसे किसी जगह बुलाया गया है। आपका साथी कहता है: "यहाँ कुछ अजीब हुआ है — पर मुझे नहीं पता क्या।" आप हर दिशा में खोजते हैं। यह two-tailed test है — दोनों तरफ़ के आश्चर्यों के लिए खुला।

想象你是一名被叫到现场的侦探。搭档说:“这里发生了怪事 —— 但我不知道是什么。”你向各个方向搜查。这就是双侧检验 —— 对两边的意外都保持开放。

Now imagine an informant tells you: "The suspect ran north." You search only northwards. That is a one-tailed test — you committed to a direction before the search began. If the suspect actually ran south, you will never find him.

अब मान लीजिए एक मुख़बिर कहता है: "संदिग्ध उत्तर की ओर भागा।" आप सिर्फ़ उत्तर में खोजते हैं। यह one-tailed test है — आपने खोज शुरू होने से पहले एक दिशा चुन ली। अगर संदिग्ध असल में दक्षिण भागा, तो आप उसे कभी नहीं ढूँढ पाएँगे।

再想象线人告诉你:“嫌疑人往北跑了。”你只往北搜。这就是单侧检验 —— 你在搜查开始之前就认定了方向。如果嫌疑人其实往南跑了,你永远找不到他。

Both approaches are valid. But choosing the wrong one — especially picking a direction after seeing your data — is one of the most common and damaging mistakes in statistics. This tutorial shows how to tell them apart, when to use each, and how the choice changes your conclusion.

दोनों तरीके सही हैं। पर ग़लत तरीका चुनना — ख़ासकर data देखने के बाद दिशा चुनना — statistics की सबसे आम और नुक़सानदेह ग़लतियों में से एक है। यह tutorial दिखाता है कि इन्हें कैसे पहचानें, कब कौन सा इस्तेमाल करें, और यह चुनाव आपके निष्कर्ष को कैसे बदलता है।

两种做法都是有效的。但选错 —— 尤其是在看到数据之后才选方向 —— 是统计学中最常见、危害最大的错误之一。本教程教你如何区分它们、各自何时使用,以及这个选择如何改变你的结论。

💡
The Golden RuleGolden Rule黄金法则

Decide one-tailed or two-tailed before you collect or look at the data. Choosing the direction after peeking at the results is a form of p-hacking: it secretly doubles the false-positive rate (from 5% to about 10% — the simulation below shows it). Done on purpose, it is research misconduct.

One-tailed या two-tailed, data जुटाने या देखने से पहले तय करें। नतीजे देखकर दिशा चुनना p-hacking का एक रूप है: यह चुपचाप false-positive दर को दोगुना कर देता है (5% से लगभग 10% — नीचे का simulation यह दिखाता है)। जानबूझकर किया जाए तो यह research misconduct है।

在收集或查看数据之前就决定单侧还是双侧。看了结果再选方向是 p-hacking 的一种:它会悄悄把假阳性率翻倍(从 5% 到约 10% —— 下面的模拟会演示)。如果是故意为之,就是学术不端。


SectionSection第 02 节

The Core Difference at a Glanceमुख्य अंतर एक नज़र में一眼看懂核心区别

Every hypothesis test gives a test statistic — a number that says how far your sample result is from what H₀ predicts. The question is: which "extreme" results count as evidence against H₀? That depends on where you put the rejection region.

हर hypothesis test एक test statistic देता है — एक संख्या जो बताती है कि आपका sample नतीजा H₀ की भविष्यवाणी से कितना दूर है। सवाल है: कौन-से "extreme" नतीजे H₀ के ख़िलाफ़ सबूत गिने जाएँ? यह इस पर निर्भर है कि आप rejection region कहाँ रखते हैं।

每个假设检验都会给出一个检验统计量 —— 表示样本结果离 H₀ 的预测有多远。问题是:哪些“极端”结果算作反驳 H₀ 的证据?这取决于你把拒绝域放在哪里。

Two-tailed testTwo-tailed test双侧检验
H₁: μ ≠ μ₀
  • Rejection regions on BOTH sidesदोनों तरफ़ rejection regions两侧都有拒绝域
  • Detects increases AND decreasesबढ़त और गिरावट दोनों पकड़ता है能发现上升和下降
  • α split: α/2 in each tailα बँटा: हर tail में α/2α 平分:每侧 α/2
  • α = 0.05 → critical z = ±1.96α = 0.05 → critical z = ±1.96α = 0.05 → 临界 z = ±1.96
  • The safe defaultसुरक्षित default稳妥的默认选择
Right-tailed testRight-tailed test右侧检验
H₁: μ > μ₀
  • Rejection region on the RIGHT onlyसिर्फ़ दाईं ओर rejection region仅右侧有拒绝域
  • Detects increases onlyसिर्फ़ बढ़त पकड़ता है只能发现上升
  • All of α in one tailपूरा α एक tail मेंα 全在一侧
  • α = 0.05 → critical z = +1.645α = 0.05 → critical z = +1.645α = 0.05 → 临界 z = +1.645
  • More power for increasesबढ़त के लिए ज़्यादा power对上升更有力
Left-tailed testLeft-tailed test左侧检验
H₁: μ < μ₀
  • Rejection region on the LEFT onlyसिर्फ़ बाईं ओर rejection region仅左侧有拒绝域
  • Detects decreases onlyसिर्फ़ गिरावट पकड़ता है只能发现下降
  • All of α in one tailपूरा α एक tail मेंα 全在一侧
  • α = 0.05 → critical z = −1.645α = 0.05 → critical z = −1.645α = 0.05 → 临界 z = −1.645
  • More power for decreasesगिरावट के लिए ज़्यादा power对下降更有力

SectionSection第 03 节

One vs Two Tails in Pictures — Understand Before the Mathsतस्वीरों में One vs Two Tails — गणित से पहले समझें图解单侧 vs 双侧 — 先理解,再算数

Three pictures tell the whole story: where the 5% goes, how one z can get two different verdicts, and what each choice does to your power.

तीन तस्वीरें पूरी कहानी बताती हैं: 5% कहाँ जाता है, एक ही z को दो अलग फ़ैसले कैसे मिल सकते हैं, और हर चुनाव आपकी power पर क्या असर डालता है।

三张图讲完整个故事:5% 放在哪里、同一个 z 如何得到两种判决、以及每种选择对检验力的影响。

📐 PICTURE 1 — WHERE THE 5% GOESतस्वीर 1 — 5% कहाँ जाता है图 1 — 5% 放在哪里
Rejection regions Two-tailed — H₁: μ ≠ μ₀Two-tailed — H₁: μ ≠ μ₀双侧 —— H₁:μ ≠ μ₀ −1.96 2.5% +1.96 2.5% 95% α split: 2.5% in each tailα बँटा: हर tail में 2.5%α 平分:每侧 2.5% Right-tailed — H₁: μ > μ₀Right-tailed — H₁: μ > μ₀右侧 —— H₁:μ > μ₀ +1.645 5% 95% all 5% in the right tailपूरा 5% दाईं tail में5% 全在右侧 Left-tailed — H₁: μ < μ₀Left-tailed — H₁: μ < μ₀左侧 —— H₁:μ < μ₀ −1.645 5% 95% all 5% in the left tailपूरा 5% बाईं tail में5% 全在左侧
⚖️ PICTURE 2 — SAME DATA (z = 1.70), DIFFERENT VERDICTतस्वीर 2 — वही DATA (z = 1.70), अलग फ़ैसला图 2 — 同样的数据(z = 1.70),不同的判决
Same z, different verdict Two-tailed testTwo-tailed test双侧检验 −1.960 +1.960 z = 1.70 p = 0.0891 p ≥ 0.05 → fail to reject H₀p ≥ 0.05 → H₀ reject नहींp ≥ 0.05 → 不拒绝 H₀ Right-tailed testRight-tailed test右侧检验 +1.645 z = 1.70 p = 0.0446 p < 0.05 → reject H₀p < 0.05 → H₀ rejectp < 0.05 → 拒绝 H₀

Orange = p-value. The two-tailed test counts both tails, so its p is exactly twice the one-tailed p.

नारंगी = p-value. Two-tailed test दोनों tails गिनता है, इसलिए उसका p, one-tailed p का ठीक दोगुना है।

橙色 = p 值。双侧检验计算两侧尾部,所以它的 p 正好是单侧 p 的两倍。

📈 PICTURE 3 — POWER: THE PRICE OF CHOOSING A DIRECTIONतस्वीर 3 — POWER: दिशा चुनने की क़ीमत图 3 — 检验力:选定方向的代价
Power of one- and two-tailed tests 0% 25% 50% 80% 100% -3 -2 -1 +0 +1 +2 +3 +4 right-tailedright-tailed右侧 two-tailedtwo-tailed双侧 effect in the "wrong" direction:effect "ग़लत" दिशा में:效应在“反方向”: one-tailed power ≈ 0one-tailed power ≈ 0单侧检验力 ≈ 0 power = 5% = α at δ = 0δ = 0 पर power = 5% = αδ = 0 时检验力 = 5% = α True effect δ (how many standard errors the real mean is from μ₀), α = 0.05असली effect δ (असली mean, μ₀ से कितने standard errors दूर है), α = 0.05真实效应 δ(真实均值离 μ₀ 有几个标准误),α = 0.05

If the effect is in the predicted direction, the one-tailed test wins. If it is in the other direction, the one-tailed test is blind.

अगर effect अनुमानित दिशा में है, तो one-tailed test जीतता है। दूसरी दिशा में हो, तो one-tailed test अंधा है।

效应与预测方向一致时,单侧检验胜出;方向相反时,单侧检验完全看不见。


SectionSection第 04 节

Explore the Rejection RegionsRejection Regions को खोजें探索拒绝域

The rejection region is the shaded area under the curve. If your test statistic lands there, you reject H₀. The same α = 5% is placed differently for each test type — that is why a one-tailed test is "more powerful" in one direction.

Rejection region, curve के नीचे का छायांकित area है। अगर आपका test statistic वहाँ गिरता है, तो आप H₀ reject करते हैं। वही α = 5% हर test type में अलग जगह रखा जाता है — इसीलिए one-tailed test एक दिशा में "ज़्यादा powerful" होता है।

拒绝域是曲线下的阴影部分。检验统计量落在那里,就拒绝 H₀。同样的 α = 5%,在不同检验类型中放的位置不同 —— 这就是单侧检验在某一方向上“更有力”的原因。

LIVELIVE互动Rejection-Region ExplorerRejection-Region Explorer拒绝域探索器

Switch the test type and α — watch the red rejection regions slide. Drag z to see the p-value (orange) and the verdict of all three tests at once.

Test type और α बदलें — लाल rejection regions को खिसकते देखें। z को खिसकाकर p-value (नारंगी) और तीनों tests का फ़ैसला एक साथ देखें।

切换检验类型和 α —— 看红色拒绝域滑动。拖动 z,同时查看 p 值(橙色)和三种检验的判决。

📐
Why One-Tailed Tests Are More Powerful (in One Direction)One-Tailed Tests (एक दिशा में) ज़्यादा Powerful क्यों为什么单侧检验(在某一方向上)更有力

At α = 0.05, a two-tailed test needs |z| > 1.96 to reject H₀. A right-tailed test needs only z > 1.645 — a lower bar. So you are more likely to detect a real effect if it goes the way you predicted. If it goes the other way, the one-tailed test misses it completely — no matter how big it is.

α = 0.05 पर two-tailed test को H₀ reject करने के लिए |z| > 1.96 चाहिए। Right-tailed test को सिर्फ़ z > 1.645 — कम ऊँची सीमा। इसलिए असली effect पकड़ने की संभावना ज़्यादा है अगर वह आपकी अनुमानित दिशा में हो। दूसरी दिशा में हो, तो one-tailed test उसे पूरी तरह चूक जाता है — चाहे वह कितना भी बड़ा हो।

α = 0.05 时,双侧检验需要 |z| > 1.96 才能拒绝 H₀。右侧检验只需 z > 1.645 —— 门槛更低。所以如果效应方向与预测一致,更容易发现它。如果方向相反,无论效应多大,单侧检验都会完全错过。

LIVELIVE互动Power Race — One Tail vs Two TailsPower की दौड़ — One Tail vs Two Tails检验力竞赛 — 单侧 vs 双侧

Move the true effect δ. Green area = the chance of rejecting H₀ (power). Try δ = 2 (one-tailed wins), δ = 0 (both 5%) and δ = −2 (one-tailed goes blind).

असली effect δ खिसकाएँ। हरा area = H₀ reject करने का chance (power)। δ = 2 (one-tailed जीतता है), δ = 0 (दोनों 5%) और δ = −2 (one-tailed अंधा) आज़माएँ।

移动真实效应 δ。绿色面积 = 拒绝 H₀ 的概率(检验力)。试试 δ = 2(单侧胜)、δ = 0(都是 5%)和 δ = −2(单侧失明)。


SectionSection第 05 节

Story 1 — The Protein Bar Company 🏋️कहानी 1 — Protein Bar कंपनी 🏋️故事 1 — 蛋白棒公司 🏋️

A sports-nutrition company launches a new protein bar and wants to claim it "speeds up muscle recovery". 40 athletes are tested. With the current standard supplement the average recovery score is 72 points, and years of past data give a spread of σ = 10 points.

एक sports-nutrition कंपनी नया protein bar लाती है और दावा करना चाहती है कि यह "muscle recovery तेज़ करता है"। 40 athletes पर test होता है। मौजूदा standard supplement के साथ औसत recovery score 72 points है, और कई साल के पुराने data से फैलाव σ = 10 points है।

一家运动营养公司推出新蛋白棒,想宣称它能“加快肌肉恢复”。在 40 名运动员身上测试。使用现有标准补剂时平均恢复分数为 72 分,多年历史数据给出的离散程度为 σ = 10 分。

Why right-tailed?Right-tailed क्यों?为什么用右侧检验?

The marketing claim is only about improvement, and it was written down before any data came in. So a right-tailed test fits the claim. (A responsible company should still check separately that the bar does not make recovery worse — a one-tailed test cannot do that job.)

Marketing का दावा सिर्फ़ सुधार के बारे में है, और data आने से पहले लिखा गया था। इसलिए right-tailed test दावे से मेल खाता है। (एक ज़िम्मेदार कंपनी को फिर भी अलग से जाँचना चाहिए कि bar recovery को बिगाड़ता नहीं — one-tailed test यह काम नहीं कर सकता।)

营销主张只涉及改善,而且是在数据出来之前写下的。所以右侧检验符合这个主张。(负责任的公司仍应另行检查蛋白棒不会让恢复变差 —— 单侧检验做不到这一点。)

🧮 Protein Bar — Right-Tailed z-testProtein Bar — Right-Tailed z-test蛋白棒 —— 右侧 z 检验
H₀
μ ≤ 72 (the new bar is no better)
μ ≤ 72 (नया bar बेहतर नहीं)
μ ≤ 72(新蛋白棒并不更好)
H₁
μ > 72 (the new bar raises recovery) — right-tailed
μ > 72 (नया bar recovery बढ़ाता है) — right-tailed
μ > 72(新蛋白棒提高恢复分数)—— 右侧
DataData数据
n = 40, x̄ = 75.8, σ = 10 (known), α = 0.05
n = 40, x̄ = 75.8, σ = 10 (ज्ञात), α = 0.05
n = 40,x̄ = 75.8,σ = 10(已知),α = 0.05
Step 1Step 1第 1 步
SE = σ / √n = 10 / √40 = 10 / 6.325 = 1.581
SE = σ / √n = 10 / √40 = 10 / 6.325 = 1.581
SE = σ / √n = 10 / √40 = 10 / 6.325 = 1.581
Step 2Step 2第 2 步
z = (75.8 − 72) / 1.581 = 3.8 / 1.581 = +2.40
z = (75.8 − 72) / 1.581 = 3.8 / 1.581 = +2.40
z = (75.8 − 72) / 1.581 = 3.8 / 1.581 = +2.40
Step 3Step 3第 3 步
Critical value (right-tailed, α = 0.05) = +1.645; p = P(Z > 2.40) = 0.0081
Critical value (right-tailed, α = 0.05) = +1.645; p = P(Z > 2.40) = 0.0081
临界值(右侧,α = 0.05)= +1.645;p = P(Z > 2.40) = 0.0081
Decisionफ़ैसला决定
z = 2.40 > 1.645 → reject H₀. The bar raises the average recovery score by about 3.8 points. ✅
z = 2.40 > 1.645 → H₀ reject। Bar औसत recovery score लगभग 3.8 points बढ़ाता है। ✅
z = 2.40 > 1.645 → 拒绝 H₀。蛋白棒使平均恢复分数提高约 3.8 分。✅
✅
What If We Had Used Two-Tailed?अगर Two-Tailed लेते तो?如果用双侧检验会怎样?

The critical value would be ±1.96 and p would double to 0.0162. Since 2.40 > 1.96, we would still reject H₀ — because the effect is large. But for a smaller z such as 1.70, the one-tailed test rejects (1.70 > 1.645) and the two-tailed test does not (1.70 < 1.96). The choice of direction has real consequences.

Critical value ±1.96 होती और p दोगुना होकर 0.0162 हो जाता। क्योंकि 2.40 > 1.96, हम फिर भी H₀ reject करते — क्योंकि effect बड़ा है। पर 1.70 जैसे छोटे z पर one-tailed test reject करता है (1.70 > 1.645) और two-tailed नहीं (1.70 < 1.96)। दिशा के चुनाव के असली नतीजे होते हैं।

临界值会是 ±1.96,p 会翻倍为 0.0162。由于 2.40 > 1.96,仍会拒绝 H₀ —— 因为效应够大。但对于较小的 z,如 1.70,单侧检验会拒绝(1.70 > 1.645),双侧不会(1.70 < 1.96)。方向的选择会带来真实的后果。


SectionSection第 06 节

Story 2 — The School Inspector 🏫कहानी 2 — School Inspector 🏫故事 2 — 学校督察 🏫

A government inspector audits schools. The national average score on a standard maths exam is 68 marks, with σ = 15 marks. The inspector has no belief about whether a particular school is above or below average — she only wants to know if it is different. This is a two-tailed test.

एक सरकारी inspector schools का audit करती है। एक standard maths exam का national औसत 68 marks है, σ = 15 marks. Inspector को कोई अंदाज़ा नहीं कि कोई school औसत से ऊपर है या नीचे — वह सिर्फ़ जानना चाहती है कि school अलग है या नहीं। यह two-tailed test है।

一位政府督察对学校进行审查。某标准数学考试的全国平均分为 68 分,σ = 15 分。督察对某所学校高于还是低于平均没有预判 —— 她只想知道它是否不同。这是双侧检验。

Why two-tailed?Two-tailed क्यों?为什么用双侧检验?

The school could be unusually good (deserving praise) or unusually weak (needing help). Both extremes matter. With no direction in mind, use two-tailed.

School असाधारण रूप से अच्छा (तारीफ़ के लायक़) या असाधारण रूप से कमज़ोर (मदद की ज़रूरत) हो सकता है। दोनों extremes मायने रखते हैं। कोई दिशा न सोची हो, तो two-tailed लें।

这所学校可能异常优秀(值得表扬),也可能异常薄弱(需要帮助)。两个极端都重要。没有预设方向时,用双侧检验。

🧮 School Audit — Two-Tailed z-testSchool Audit — Two-Tailed z-test学校审查 —— 双侧 z 检验
H₀
μ = 68 (the school matches the national average)
μ = 68 (school national औसत के बराबर)
μ = 68(该校与全国平均相同)
H₁
μ ≠ 68 (the school is different) — two-tailed
μ ≠ 68 (school अलग है) — two-tailed
μ ≠ 68(该校不同)—— 双侧
DataData数据
n = 50 students, x̄ = 63 marks, σ = 15, α = 0.05
n = 50 छात्र, x̄ = 63 marks, σ = 15, α = 0.05
n = 50 名学生,x̄ = 63 分,σ = 15,α = 0.05
Step 1Step 1第 1 步
SE = 15 / √50 = 15 / 7.071 = 2.121
SE = 15 / √50 = 15 / 7.071 = 2.121
SE = 15 / √50 = 15 / 7.071 = 2.121
Step 2Step 2第 2 步
z = (63 − 68) / 2.121 = −5 / 2.121 = −2.36
z = (63 − 68) / 2.121 = −5 / 2.121 = −2.36
z = (63 − 68) / 2.121 = −5 / 2.121 = −2.36
Step 3Step 3第 3 步
Critical values = ±1.96; p = 2 × P(Z > 2.36) = 0.0184
Critical values = ±1.96; p = 2 × P(Z > 2.36) = 0.0184
临界值 = ±1.96;p = 2 × P(Z > 2.36) = 0.0184
Decisionफ़ैसला决定
|−2.36| > 1.96 → reject H₀. The school's average differs from the national average — it is about 5 marks lower. 🚨 Follow-up support is triggered.
|−2.36| > 1.96 → H₀ reject। School का औसत national औसत से अलग है — लगभग 5 marks कम। 🚨 आगे की मदद शुरू होती है।
|−2.36| > 1.96 → 拒绝 H₀。该校平均分与全国平均不同 —— 低约 5 分。🚨 启动后续帮扶。

SectionSection第 07 节

Story 3 — The Defective Microchip 💻कहानी 3 — ख़राब Microchip 💻故事 3 — 有缺陷的芯片 💻

A semiconductor plant should have a defect rate of no more than 2%. The QC engineer raises an alarm only if the rate rises above 2%; a lower rate is good news and needs no action. This is a right-tailed test on a proportion.

एक semiconductor plant में defect दर 2% से ज़्यादा नहीं होनी चाहिए। QC engineer सिर्फ़ तब alarm देता है जब दर 2% से ऊपर जाए; कम दर अच्छी ख़बर है और कुछ करने की ज़रूरत नहीं। यह proportion पर right-tailed test है।

某半导体工厂的次品率不应超过 2%。质检工程师只在次品率升到 2% 以上时报警;更低是好消息,无需处理。这是针对比例的右侧检验。

🧮 Microchip QC — Right-Tailed Proportion z-testMicrochip QC — Right-Tailed Proportion z-test芯片质检 —— 右侧比例 z 检验
H₀
p ≤ 0.02 (defect rate within the limit)
p ≤ 0.02 (defect दर सीमा में)
p ≤ 0.02(次品率在限度内)
H₁
p > 0.02 (defect rate above the limit) — right-tailed
p > 0.02 (defect दर सीमा से ऊपर) — right-tailed
p > 0.02(次品率超限)—— 右侧
DataData数据
n = 500 chips, 16 defects → p̂ = 16/500 = 0.032 (3.2%)
n = 500 chips, 16 defects → p̂ = 16/500 = 0.032 (3.2%)
n = 500 片,16 片次品 → p̂ = 16/500 = 0.032(3.2%)
FormulaFormula公式
z = (p̂ − p₀) / √(p₀(1 − p₀)/n)
z = (p̂ − p₀) / √(p₀(1 − p₀)/n)
z = (p̂ − p₀) / √(p₀(1 − p₀)/n)
Step 1Step 1第 1 步
SE = √(0.02 × 0.98 / 500) = √0.0000392 = 0.00626
SE = √(0.02 × 0.98 / 500) = √0.0000392 = 0.00626
SE = √(0.02 × 0.98 / 500) = √0.0000392 = 0.00626
Step 2Step 2第 2 步
z = 0.012 / 0.00626 = +1.92; p = P(Z > 1.92) = 0.0276
z = 0.012 / 0.00626 = +1.92; p = P(Z > 1.92) = 0.0276
z = 0.012 / 0.00626 = +1.92;p = P(Z > 1.92) = 0.0276
Decisionफ़ैसला决定
1.92 > 1.645 → reject H₀. The defect rate is significantly above 2%. Check the line! 🛑
1.92 > 1.645 → H₀ reject। Defect दर 2% से काफ़ी ऊपर है। Line जाँचें! 🛑
1.92 > 1.645 → 拒绝 H₀。次品率显著高于 2%。检查产线!🛑
⚠️
Would Two-Tailed Have Caught This? And a Word on the Approximationक्या Two-Tailed इसे पकड़ता? और Approximation पर एक बात双侧检验能发现吗?以及关于近似的说明

With a two-tailed test (critical value ±1.96), z = 1.92 falls just short, and the problem would have been missed — a Type II error with real costs. Here the one-tailed test is the right tool because only one direction calls for action.

One more check: the z-test uses a normal approximation, which is rough when the expected count is small (n·p₀ = 10 defects). The exact binomial test gives p = 0.047 instead of 0.028 — still below 0.05, but only just. For rare events, prefer the exact test (see the Python section).

Two-tailed test (critical value ±1.96) में z = 1.92 ज़रा-सा कम पड़ता है, और समस्या छूट जाती — असली क़ीमत वाला Type II error. यहाँ one-tailed test सही tool है क्योंकि सिर्फ़ एक दिशा में कार्रवाई चाहिए।

एक और जाँच: z-test normal approximation इस्तेमाल करता है, जो तब मोटा-मोटा होता है जब अपेक्षित संख्या छोटी हो (n·p₀ = 10 defects)। Exact binomial test 0.028 की जगह p = 0.047 देता है — अब भी 0.05 से नीचे, पर बस ज़रा-सा। दुर्लभ घटनाओं के लिए exact test बेहतर है (Python section देखें)।

用双侧检验(临界值 ±1.96),z = 1.92 差一点点,问题就会被漏掉 —— 这是有实际代价的第二类错误。这里单侧检验是正确的工具,因为只有一个方向需要采取行动。

还有一点:z 检验用的是正态近似,当期望数较小时(n·p₀ = 10 片次品)比较粗糙。精确二项检验给出 p = 0.047 而不是 0.028 —— 仍低于 0.05,但只是勉强。对于稀有事件,优先用精确检验(见 Python 部分)。

LIVELIVE互动Factory Line MonitorFactory Line Monitor产线监控器

Set the true defect rate, then inspect batches of 500 chips (red = defect). Each batch gives a z. Compare how often the right-tailed and two-tailed rules raise an alarm. Try 2.0% (no problem), 3.2% (a real problem) and 1.0% (better than required).

असली defect दर चुनें, फिर 500 chips के batches जाँचें (लाल = defect)। हर batch एक z देता है। तुलना करें कि right-tailed और two-tailed नियम कितनी बार alarm देते हैं। 2.0% (कोई समस्या नहीं), 3.2% (असली समस्या) और 1.0% (ज़रूरत से बेहतर) आज़माएँ।

设置真实次品率,然后检查每批 500 片芯片(红色 = 次品)。每批得到一个 z。比较右侧规则和双侧规则的报警频率。试试 2.0%(没问题)、3.2%(真有问题)和 1.0%(比要求更好)。


SectionSection第 08 节

The p-value Differencep-value का अंतरp 值的区别

The p-value formula depends on the tail. Many students use the wrong p-value because they forget this.

p-value का formula tail पर निर्भर करता है। कई छात्र यह भूलकर ग़लत p-value इस्तेमाल करते हैं।

p 值的公式取决于尾的方向。许多学生忘了这一点,用错了 p 值。

Two-tailed p-valueTwo-tailed p-value双侧 p 值
p = 2 × P(Z > |z|)
Double the one-tail area, so both extremes count equally.
एक tail के area को दोगुना करें, ताकि दोनों extremes बराबर गिने जाएँ।
把单侧面积乘以 2,使两个极端同等计入。
Right-tailed p-valueRight-tailed p-value右侧 p 值
p = P(Z > z)
The chance of a value this large or larger.
इतनी या इससे बड़ी value का chance.
得到这么大或更大数值的概率。
Left-tailed p-valueLeft-tailed p-value左侧 p 值
p = P(Z < z)
The chance of a value this small or smaller.
इतनी या इससे छोटी value का chance.
得到这么小或更小数值的概率。
Decision ruleDecision rule决策规则
Reject H₀ if p < α
The same for all three tests — only the p-value calculation differs.
तीनों tests के लिए एक जैसा — सिर्फ़ p-value की गणना अलग है।
三种检验都一样 —— 只有 p 值的计算不同。
Test statistic zTest statistic z检验统计量 zTwo-tailed pTwo-tailed p双侧 pRight-tailed pRight-tailed p右侧 pLeft-tailed pLeft-tailed p左侧 pReject H₀ at α = 0.05?α = 0.05 पर H₀ reject?α = 0.05 时拒绝 H₀?
z = +1.700.08910.04460.9554Two: noTwo: नहीं双侧:否 Right: yesRight: हाँ右侧:是 Left: noLeft: नहीं左侧:否
z = -1.700.08910.95540.0446Two: noTwo: नहीं双侧:否 Right: noRight: नहीं右侧:否 Left: yesLeft: हाँ左侧:是
z = +2.100.03570.01790.9821Two: yesTwo: हाँ双侧:是 Right: yesRight: हाँ右侧:是 Left: noLeft: नहीं左侧:否
z = -2.100.03570.98210.0179Two: yesTwo: हाँ双侧:是 Right: noRight: नहीं右侧:否 Left: yesLeft: हाँ左侧:是
z = +1.200.23010.11510.8849Two: noTwo: नहीं双侧:否 Right: noRight: नहीं右侧:否 Left: noLeft: नहीं左侧:否
💡
Key Insight from the TableTable से मुख्य सीख表格的关键启示

Look at z = +1.70. The two-tailed p (0.089) does not reject H₀, but the right-tailed p (0.045) does. Same data, same z, different conclusion — only because of the test chosen. Also notice z = +1.70 under a left-tailed test: p = 0.955. A one-tailed test pointed the wrong way can never reject, however strong the effect.

z = +1.70 देखें। Two-tailed p (0.089) H₀ reject नहीं करता, पर right-tailed p (0.045) करता है। वही data, वही z, अलग निष्कर्ष — सिर्फ़ चुने गए test की वजह से। Left-tailed test में z = +1.70 भी देखें: p = 0.955. ग़लत दिशा में इशारा करता one-tailed test कभी reject नहीं कर सकता, effect चाहे कितना भी मज़बूत हो।

看 z = +1.70。双侧 p(0.089)不拒绝 H₀,右侧 p(0.045)却拒绝。同样的数据、同样的 z,结论不同 —— 只因为选的检验不同。再看 z = +1.70 在左侧检验下:p = 0.955。方向指错的单侧检验,无论效应多强都无法拒绝。


SectionSection第 09 节

Critical Values Quick ReferenceCritical Values — झटपट संदर्भ临界值速查表

These are the most used critical z-values. For t-tests the critical values also depend on the degrees of freedom (df = n − 1), but the same directional logic applies.

ये सबसे ज़्यादा इस्तेमाल होने वाली critical z-values हैं। t-tests में critical values degrees of freedom (df = n − 1) पर भी निर्भर करती हैं, पर दिशा का तर्क वही है।

这些是最常用的临界 z 值。t 检验的临界值还取决于自由度(df = n − 1),但方向的逻辑相同。

Significance level αSignificance level α显著性水平 αTwo-tailed (±)Two-tailed (±)双侧(±)Right-tailed (+)Right-tailed (+)右侧(+)Left-tailed (−)Left-tailed (−)左侧(−)
α = 0.1±1.645+1.282−1.282
α = 0.05±1.960+1.645−1.645
α = 0.02±2.326+2.054−2.054
α = 0.01±2.576+2.326−2.326
α = 0.001±3.291+3.090−3.090
📌
Memory Trickयाद रखने की तरकीब记忆窍门

A one-tailed critical value at α equals the two-tailed critical value at 2α. So the one-tailed value at 0.05 (1.645) is the two-tailed value at 0.10, and the one-tailed value at 0.01 (2.326) is the two-tailed value at 0.02. Remember 1.96 (two-tailed, 0.05) and 1.645 (one-tailed, 0.05) — they appear everywhere.

α पर one-tailed critical value, 2α पर two-tailed critical value के बराबर होती है। इसलिए 0.05 पर one-tailed value (1.645), 0.10 पर two-tailed value है, और 0.01 पर one-tailed value (2.326), 0.02 पर two-tailed value है। 1.96 (two-tailed, 0.05) और 1.645 (one-tailed, 0.05) याद रखें — ये हर जगह आती हैं।

α 下的单侧临界值等于 2α 下的双侧临界值。所以 0.05 的单侧值(1.645)就是 0.10 的双侧值,0.01 的单侧值(2.326)就是 0.02 的双侧值。记住 1.96(双侧,0.05)和 1.645(单侧,0.05)—— 它们无处不在。


SectionSection第 10 节

How to Choose: Three Questionsकैसे चुनें: तीन सवाल如何选择:三个问题

Answer these three questions, in order, before running any test.

कोई भी test चलाने से पहले, इन तीन सवालों के जवाब क्रम से दें।

在做任何检验之前,按顺序回答这三个问题。

🎯 The Three Questions — Answer Before You Collect Dataतीन सवाल — Data जुटाने से पहले जवाब दें三个问题 —— 收集数据前回答
Q1
Do I have a directional prediction? If theory or earlier evidence tells you the effect will go one way (higher or lower), you have one. If you are only asking "is there any difference?", you do not.
क्या मेरे पास दिशा की भविष्यवाणी है? अगर theory या पहले के सबूत बताते हैं कि effect एक दिशा (ऊपर या नीचे) में जाएगा, तो है। अगर आप सिर्फ़ पूछ रहे हैं "क्या कोई अंतर है?", तो नहीं।
我有方向性的预测吗?如果理论或已有证据告诉你效应会朝某个方向(更高或更低),那就有。如果你只是问“有没有差异?”,那就没有。
Q2
Would a result in the opposite direction matter? If a drug made patients worse, would that change your decision? If yes, use a two-tailed test. Use one-tailed only if the opposite direction truly needs no action (like a lower defect rate).
क्या उल्टी दिशा का नतीजा मायने रखेगा? अगर दवा मरीज़ों को बदतर कर दे, तो क्या आपका फ़ैसला बदलेगा? हाँ, तो two-tailed test लें। One-tailed सिर्फ़ तब, जब उल्टी दिशा में सच में कोई कार्रवाई न चाहिए (जैसे कम defect दर)।
相反方向的结果重要吗?如果药物让患者更糟,会改变你的决定吗?会的话,用双侧检验。只有当相反方向确实不需要任何行动时(如次品率更低),才用单侧。
Q3
Does the direction come from theory — not from the data? Use one-tailed only if the direction was fixed by prior knowledge and written down in advance. If you are choosing it because you peeked at the data, stop: use two-tailed, or your p-values are invalid.
क्या दिशा theory से आई है — data से नहीं? One-tailed सिर्फ़ तब, जब दिशा पहले की जानकारी से तय हुई और पहले से लिखी गई हो। अगर data देखकर चुन रहे हैं, रुकें: two-tailed लें, वरना आपके p-values अमान्य हैं।
方向来自理论 —— 而不是数据吗?只有方向由已有知识确定、并事先写明时,才用单侧。如果是偷看数据后才选的,停下:用双侧,否则你的 p 值无效。
Research questionResearch सवाल研究问题Test typeTest type检验类型Reasonकारण理由
Does this new fertiliser change crop yield?क्या यह नया fertiliser फ़सल की पैदावार बदलता है?这种新肥料会改变作物产量吗?Two-tailedTwo-tailed双侧It could raise or lower yield, and both matterपैदावार बढ़ा या घटा सकता है, दोनों मायने रखते हैं可能提高也可能降低产量,两者都重要
Is this coin fair?क्या यह coin fair है?这枚硬币公平吗?Two-tailedTwo-tailed双侧Bias could be towards heads or tailsझुकाव heads या tails किसी ओर हो सकता है可能偏向正面,也可能偏向反面
Has the defect rate risen above 2%?क्या defect दर 2% से ऊपर गई?次品率是否升到 2% 以上?Right-tailedRight-tailed右侧Only an increase calls for actionसिर्फ़ बढ़त पर कार्रवाई चाहिए只有上升才需要行动
Does a training programme raise output enough to pay for itself?क्या training programme output इतना बढ़ाता है कि ख़र्च निकल आए?培训项目能否把产出提高到足以收回成本?Right-tailedRight-tailed右侧The decision only changes if output goes upफ़ैसला सिर्फ़ output बढ़ने पर बदलता है只有产出提高才会改变决定
Does energy-drink use reduce sleep time?क्या energy drink पीने से नींद का समय घटता है?喝能量饮料会减少睡眠时间吗?Left-tailedLeft-tailed左侧A clear prior reason (caffeine) predicts a decreaseसाफ़ पूर्व कारण (caffeine) गिरावट बताता है有明确的先验理由(咖啡因)预测下降
Does a new pain medicine lower pain scores?क्या नई दर्द की दवा दर्द scores घटाती है?新止痛药能降低疼痛评分吗?Two-tailed (or one-tailed at α = 0.025)Two-tailed (या α = 0.025 पर one-tailed)双侧(或 α = 0.025 的单侧)A drug that makes pain worse matters a lot; regulators expect thisदर्द बढ़ाने वाली दवा बहुत मायने रखती है; regulators यही चाहते हैं让疼痛加重的药非常重要;监管机构要求如此
⚠️
Medicine Is a Special CaseMedicine एक ख़ास मामला है医学是特例

In clinical trials, a harmful effect is always important, so regulators (for example the international ICH E9 guideline) expect a two-sided test at α = 0.05 — or, if a one-sided test is used, α = 0.025, which gives the same evidence bar. A one-sided test at 0.05 in a drug trial would quietly make approval easier.

Clinical trials में नुक़सानदेह effect हमेशा ज़रूरी है, इसलिए regulators (जैसे अंतरराष्ट्रीय ICH E9 guideline) α = 0.05 पर two-sided test चाहते हैं — या one-sided test हो तो α = 0.025, जो सबूत की वही सीमा देता है। Drug trial में 0.05 पर one-sided test चुपचाप मंज़ूरी आसान कर देगा।

在临床试验中,有害效应始终很重要,所以监管机构(如国际 ICH E9 指南)要求 α = 0.05 的双侧检验 —— 若使用单侧检验,则 α = 0.025,证据门槛相同。药物试验中用 0.05 的单侧检验,会悄悄降低获批门槛。


SectionSection第 11 节

The Danger of Switching Tails 🚨Tail बदलने का ख़तरा 🚨换尾的危险 🚨

A researcher runs an experiment and gets z = +1.80. With the planned two-tailed test (critical ±1.96), p = 0.072 — not significant. Disappointed, the researcher decides after seeing the result to switch to a right-tailed test (critical 1.645). Now p = 0.036 and the result is "significant".

एक researcher प्रयोग चलाता है और z = +1.80 पाता है। तय two-tailed test (critical ±1.96) में p = 0.072 — significant नहीं। निराश होकर researcher नतीजा देखने के बाद right-tailed test (critical 1.645) पर जाने का फ़ैसला करता है। अब p = 0.036 और नतीजा "significant" है।

一位研究者做实验得到 z = +1.80。按计划的双侧检验(临界 ±1.96),p = 0.072 —— 不显著。失望之下,研究者在看到结果之后改用右侧检验(临界 1.645)。现在 p = 0.036,结果“显著”了。

This is p-hacking. The direction was not predicted in advance; it was chosen because it gave a nicer answer. Anyone who always picks the tail that matches their data is really rejecting whenever |z| > 1.645 — and on pure noise that happens about 10% of the time, not 5%. Watch it happen:

यह p-hacking है। दिशा पहले से नहीं बताई गई थी; वह इसलिए चुनी गई क्योंकि उससे अच्छा जवाब मिला। जो हमेशा data से मेल खाती tail चुनता है, वह असल में |z| > 1.645 होने पर reject करता है — और शुद्ध शोर पर ऐसा लगभग 10% बार होता है, 5% नहीं। इसे होते देखें:

这就是 p-hacking。方向不是事先预测的,而是因为能得到更好看的答案才选的。总是选与数据相符那一侧的人,实际上是只要 |z| > 1.645 就拒绝 —— 在纯噪声上这大约有 10% 的概率发生,而不是 5%。看看它如何发生:

LIVELIVE互动The Tail-Switching TrapTail बदलने का जाल换尾陷阱

Every experiment here has NO real effect. Each dot is one z. Red dots (|z| > 1.96) count as "significant" for the planned two-tailed test and for the peeker; orange dots fool only the researcher who picks the tail after peeking. The bars show the real false-positive rates.

यहाँ हर प्रयोग में कोई असली effect नहीं है। हर dot एक z है। लाल dots (|z| > 1.96) तय two-tailed test और झाँकने वाले, दोनों के लिए "significant" हैं; नारंगी dots सिर्फ़ उस researcher को धोखा देते हैं जो देखने के बाद tail चुनता है। Bars असली false-positive दरें दिखाते हैं।

这里每个实验都没有真实效应。每个点是一个 z。红点(|z| > 1.96)对事先定好的双侧检验和偷看者都算“显著”;橙点只骗过看了数据再选尾的研究者。柱状图显示真实的假阳性率。

⚠️
The Replication Crisis — A Real ConsequenceReplication Crisis — एक असली नतीजा可重复性危机 —— 真实的后果

In a large 2015 project (the Open Science Collaboration, published in Science), researchers repeated 100 published psychology studies. 97% of the originals had reported significant results, but only about 36% of the repeats did. The causes include small samples, publication of only "positive" results and flexible analysis choices — such as picking the tail, the outcome or the test after seeing the data. Writing the hypotheses and test direction down publicly in advance (pre-registration) is now encouraged by many journals.

2015 के एक बड़े project (Open Science Collaboration, Science में प्रकाशित) में researchers ने 100 प्रकाशित psychology studies दोहराईं। मूल studies में 97% ने significant नतीजे बताए थे, पर दोहराने पर सिर्फ़ लगभग 36% में मिले। कारणों में छोटे samples, सिर्फ़ "positive" नतीजों का प्रकाशन और लचीले analysis चुनाव शामिल हैं — जैसे data देखने के बाद tail, outcome या test चुनना। Hypotheses और test की दिशा पहले से सार्वजनिक रूप से लिखना (pre-registration) अब कई journals प्रोत्साहित करते हैं।

在 2015 年的一个大型项目(开放科学合作组织,发表于《科学》)中,研究者重复了 100 项已发表的心理学研究。原始研究中 97% 报告了显著结果,但重复研究中只有约 36% 显著。原因包括样本小、只发表“阳性”结果以及灵活的分析选择 —— 例如看了数据再选尾、选指标或选检验。事先公开写明假设和检验方向(预注册)现已被许多期刊所鼓励。


SectionSection第 12 节

Python ImplementationPython ImplementationPython 实现

The three stories in codeतीनों कहानियाँ code में用代码实现三个故事

import numpy as np
from scipy import stats

def z_test(xbar, mu0, sigma, n, tail):
    """One-sample z-test (σ known). tail: 'two', 'right' or 'left'."""
    z = (xbar - mu0) / (sigma / np.sqrt(n))
    if tail == "two":
        p = 2 * stats.norm.sf(abs(z))
    elif tail == "right":
        p = stats.norm.sf(z)
    else:
        p = stats.norm.cdf(z)
    return z, p

# Story 1 — protein bar (right-tailed)
z, p = z_test(75.8, 72, 10, 40, "right")
print(f"Protein bar  (right): z = {z:+.3f}, p = {p:.4f}")

# Story 2 — school exam scores (two-tailed)
z, p = z_test(63, 68, 15, 50, "two")
print(f"School       (two):   z = {z:+.3f}, p = {p:.4f}")

# Story 3 — microchip defects (right-tailed, proportion)
n, x, p0 = 500, 16, 0.02
p_hat = x / n
z = (p_hat - p0) / np.sqrt(p0 * (1 - p0) / n)
print(f"Microchips   (right): z = {z:+.3f}, p = {stats.norm.sf(z):.4f}  (normal approx.)")
p_exact = stats.binomtest(x, n, p0, alternative="greater").pvalue
print(f"Microchips   (right): exact binomial p = {p_exact:.4f}")
OUTPUT
Protein bar (right): z = +2.403, p = 0.0081 School (two): z = -2.357, p = 0.0184 Microchips (right): z = +1.917, p = 0.0276 (normal approx.) Microchips (right): exact binomial p = 0.0470

One z, three p-valuesएक z, तीन p-values一个 z,三个 p 值

from scipy import stats

print(f"{'z':>6} {'two-tailed':>11} {'right':>8} {'left':>8}")
for z in [1.70, -1.70, 2.10, -2.10, 1.20]:
    two   = 2 * stats.norm.sf(abs(z))
    right = stats.norm.sf(z)        # P(Z > z)
    left  = stats.norm.cdf(z)       # P(Z < z)
    print(f"{z:+6.2f} {two:11.4f} {right:8.4f} {left:8.4f}")
OUTPUT
z two-tailed right left +1.70 0.0891 0.0446 0.9554 -1.70 0.0891 0.9554 0.0446 +2.10 0.0357 0.0179 0.9821 -2.10 0.0357 0.9821 0.0179 +1.20 0.2301 0.1151 0.8849

Critical values from scipy.stats.norm.ppfscipy.stats.norm.ppf से critical values用 scipy.stats.norm.ppf 求临界值

from scipy import stats

print(f"{'alpha':>6} {'two-tailed':>11} {'one-tailed':>11}")
for a in [0.10, 0.05, 0.02, 0.01, 0.001]:
    print(f"{a:6.3f} {'±%.3f' % stats.norm.ppf(1 - a/2):>11} {'%.3f' % stats.norm.ppf(1 - a):>11}")
OUTPUT
alpha two-tailed one-tailed 0.100 ±1.645 1.282 0.050 ±1.960 1.645 0.020 ±2.326 2.054 0.010 ±2.576 2.326 0.001 ±3.291 3.090

t-tests: the 'alternative' argumentt-tests: 'alternative' argumentt 检验:'alternative' 参数

import numpy as np
from scipy import stats

# SciPy t-tests take the tail through the 'alternative' argument
rng = np.random.default_rng(1)
scores = rng.normal(75.8, 10, 40)         # 40 athletes, protein bar

for alt in ["two-sided", "greater", "less"]:
    res = stats.ttest_1samp(scores, popmean=72, alternative=alt)
    print(f"alternative={alt:<10} t = {res.statistic:+.3f}   p = {res.pvalue:.4f}")
OUTPUT
alternative=two-sided t = +2.571 p = 0.0141 alternative=greater t = +2.571 p = 0.0070 alternative=less t = +2.571 p = 0.9930

SciPy's alternative argument (version 1.6 and later) selects the tail: 'two-sided', 'greater' (right-tailed) or 'less' (left-tailed). Notice the right-tailed p is exactly half the two-tailed p, and the left-tailed p is 1 minus that.

SciPy का alternative argument (version 1.6 और बाद में) tail चुनता है: 'two-sided', 'greater' (right-tailed) या 'less' (left-tailed)। ध्यान दें, right-tailed p, two-tailed p का ठीक आधा है, और left-tailed p उसका 1 घटा।

SciPy 的 alternative 参数(1.6 及以上版本)用于选择尾:'two-sided'、'greater'(右侧)或 'less'(左侧)。注意右侧 p 正好是双侧 p 的一半,左侧 p 则是 1 减去它。

Simulation: what tail-switching does to false positivesSimulation: tail बदलने से false positives पर असर模拟:换尾对假阳性的影响

import numpy as np

# 100,000 experiments where H₀ is TRUE (z ~ N(0, 1))
rng = np.random.default_rng(0)
z = rng.standard_normal(100_000)

honest_two   = np.mean(np.abs(z) > 1.960)   # planned two-tailed
honest_right = np.mean(z > 1.645)           # planned right-tailed
switcher     = np.mean(np.abs(z) > 1.645)   # picks the tail AFTER seeing the sign

print(f"Planned two-tailed:           {honest_two*100:.1f}% false positives")
print(f"Planned right-tailed:         {honest_right*100:.1f}% false positives")
print(f"Choose tail after peeking:    {switcher*100:.1f}% false positives")
OUTPUT
Planned two-tailed: 5.0% false positives Planned right-tailed: 4.9% false positives Choose tail after peeking: 9.9% false positives

Power: one-tailed vs two-tailedPower: one-tailed vs two-tailed检验力:单侧 vs 双侧

from scipy import stats

# Power to detect a true shift of delta standard errors (α = 0.05)
print(f"{'delta':>6} {'right-tailed':>13} {'two-tailed':>11}")
for d in [-1.0, 0.0, 1.0, 2.0, 2.5, 3.0]:
    right = stats.norm.sf(1.645 - d)
    two   = stats.norm.sf(1.960 - d) + stats.norm.cdf(-1.960 - d)
    print(f"{d:+6.1f} {right*100:12.1f}% {two*100:10.1f}%")
OUTPUT
delta right-tailed two-tailed -1.0 0.4% 17.0% +0.0 5.0% 5.0% +1.0 25.9% 17.0% +2.0 63.9% 51.6% +2.5 80.4% 70.5% +3.0 91.2% 85.1%

SectionSection第 13 节

Summary — Side by Sideसारांश — साथ-साथ总结 — 并排对比

FeatureFeature特征Two-tailedTwo-tailed双侧Right-tailedRight-tailed右侧Left-tailedLeft-tailed左侧
H₁H₁H₁μ ≠ μ₀μ > μ₀μ < μ₀
Rejection regionRejection region拒绝域Both tailsदोनों tails两侧Right tail onlyसिर्फ़ दाईं tail仅右侧Left tail onlyसिर्फ़ बाईं tail仅左侧
Critical z (α = 0.05)Critical z (α = 0.05)临界 z(α = 0.05)±1.960+1.645−1.645
p-valuep-valuep 值2 × P(Z > |z|)P(Z > z)P(Z < z)
Power in the predicted directionअनुमानित दिशा में power预测方向上的检验力Lowerकम较低Higherज़्यादा较高Higherज़्यादा较高
Detects the unexpected directionअनपेक्षित दिशा पकड़ता है能发现意外方向Yesहाँ是Neverकभी नहीं永远不能Neverकभी नहीं永远不能
Needs a direction fixed in advanceपहले से तय दिशा चाहिए需要事先确定方向Noनहीं否Yesहाँ是Yesहाँ是
Default when unsureशक हो तो default拿不准时的默认✓ Yes✓ हाँ✓ 是——
🧮
The Bottom Lineनिचोड़一句话总结

When in doubt, use a two-tailed test — it is the safe and defensible choice, and it is what most journals and regulators expect. Use a one-tailed test only when a clear direction was written down before the data, and when an effect in the other direction would truly not change any decision. The extra power of a one-tailed test is fair only if you earned it by committing in advance.

शक हो तो two-tailed test लें — यह सुरक्षित और बचाव-योग्य चुनाव है, और ज़्यादातर journals और regulators यही चाहते हैं। One-tailed test सिर्फ़ तब लें जब साफ़ दिशा data से पहले लिखी गई हो, और जब दूसरी दिशा का effect सच में कोई फ़ैसला न बदले। One-tailed test की अतिरिक्त power तभी उचित है जब आपने उसे पहले से प्रतिबद्ध होकर कमाया हो।

拿不准时就用双侧检验 —— 它稳妥、站得住脚,也是大多数期刊和监管机构的要求。只有当明确的方向在数据之前就已写明,并且另一方向的效应确实不会改变任何决定时,才用单侧检验。单侧检验的额外检验力,只有在你事先承诺方向的前提下才是正当的。