Foundations of Data Science 📂 Inferential Statistics · 2 of 8 148 min read

Estimation Theory

A complete guide to estimation theory in statistics — covering point vs interval estimation, how confidence intervals are built and interpreted, what margin of error really means, the confidence–width trade-off, and full Python implementations using NumPy, SciPy and the t-distribution. Includes three SVG diagrams, a real LED bulb step-by-step worked example, and stories from election polling, archaeology, and quality control.

🌐
SectionSection第 01 节

The Iceman, the Doctor & the Opinion PollIceman, Doctor और Opinion Poll冰人、医生与民意调查

In 1991, two hikers in the Alps found a frozen body — now famous as Ötzi the Iceman. Nobody could go back in time to watch him live. Yet scientists answered two questions with evidence. Radiocarbon dating showed that he died about 5,300 years ago. Studies of his bones and teeth showed that he was about 45 years old when he died. Not a guess. Not a certainty. An estimate with a margin of error.

1991 में Alps में दो hikers को एक जमा हुआ शरीर मिला — आज वह Ötzi the Iceman के नाम से मशहूर है। कोई समय में पीछे जाकर उसे जीते हुए नहीं देख सकता था। फिर भी वैज्ञानिकों ने सबूतों से दो सवालों के जवाब दिए। Radiocarbon dating से पता चला कि उसकी मौत लगभग 5,300 साल पहले हुई। उसकी हड्डियों और दाँतों की जाँच से पता चला कि मौत के समय वह लगभग 45 साल का था। अंदाज़ा नहीं। पक्का भी नहीं। Margin of error के साथ एक estimate।

1991 年,两名徒步者在阿尔卑斯山发现了一具冰冻的遗体 —— 也就是后来著名的冰人奥茨(Ötzi)。没有人能回到过去看他生活。但科学家用证据回答了两个问题。放射性碳定年表明他死于大约 5,300 年前。对他骨骼和牙齿的研究表明,他去世时大约 45 岁。不是瞎猜,也不是确定无疑,而是一个带误差范围的估计。

A doctor measures a patient's blood pressure three times and says: "Your average systolic pressure is 138 mmHg — we should look into it." She did not measure every heartbeat of the patient's life. She took a small sample and made an inference about the patient's true, usual blood pressure.

एक doctor मरीज़ का blood pressure तीन बार मापकर कहती है: "आपका औसत systolic pressure 138 mmHg है — इसकी जाँच करनी चाहिए।" उसने मरीज़ की ज़िंदगी की हर धड़कन नहीं मापी। उसने छोटा sample लिया और मरीज़ के असली, सामान्य blood pressure के बारे में inference किया।

医生给病人测了三次血压,然后说:“你的平均收缩压是 138 mmHg —— 我们应该进一步检查。”她没有测量病人一生中的每一次心跳。她只取了一个小样本,然后推断病人真实的、平时的血压。

💡
Every Real-World Estimate Works This Wayअसली दुनिया का हर Estimate ऐसे ही काम करता है现实中的每个估计都是这样运作的

Before an election, a poll says: "Party A will get 43% of votes — margin of error ±3%, 95% confidence." That one sentence holds all of estimation theory: a point estimate (43%), an interval estimate (40%–46%), a confidence level (95%) and a margin of error (±3%). This tutorial explains what each number means — and what it does not mean.

चुनाव से पहले एक poll कहता है: "Party A को 43% वोट मिलेंगे — margin of error ±3%, 95% confidence." इस एक वाक्य में पूरी estimation theory है: एक point estimate (43%), एक interval estimate (40%–46%), एक confidence level (95%) और एक margin of error (±3%)। यह tutorial बताता है कि हर संख्या का क्या मतलब है — और क्या मतलब नहीं है।

选举前,一项民调说:“A 党将获得 43% 的选票 —— 误差范围 ±3%,置信水平 95%。”这一句话包含了整个估计理论:点估计(43%)、区间估计(40%–46%)、置信水平(95%)和误差范围(±3%)。本教程解释每个数字的含义 —— 以及它不代表什么。

Estimation theory tells us how to make such estimates, how precise they are, and how much to trust them. It is the engine behind clinical trials, quality control, A/B tests, credit-risk models and most data-driven decisions.

Estimation theory बताती है कि ऐसे estimates कैसे बनाएँ, वे कितने सटीक हैं, और उन पर कितना भरोसा करें। यही clinical trials, quality control, A/B tests, credit-risk models और ज़्यादातर data-आधारित फ़ैसलों का इंजन है।

估计理论告诉我们如何做出这样的估计、它们有多精确、以及该多大程度相信它们。它是临床试验、质量控制、A/B 测试、信用风险模型以及大多数数据驱动决策背后的引擎。


SectionSection第 02 节

The Two Branches of EstimationEstimation की दो शाखाएँ估计的两大分支

When you have a sample and want to say something about the population, you have two tools. You can give a single best-guess number, or a range of believable values. You almost always need both.

जब आपके पास sample हो और आप population के बारे में कुछ कहना चाहें, तो दो tools हैं। आप एक सबसे अच्छा अनुमान (एक संख्या) दे सकते हैं, या भरोसेमंद values की एक range। लगभग हमेशा दोनों चाहिए।

当你有一个样本、想对总体下结论时,有两种工具:给出一个最佳猜测数值,或给出一个可信数值的范围。你几乎总是两者都需要。

Point estimationPoint estimation点估计
One valueएक value一个数值
  • One number as the best guessसबसे अच्छे अनुमान के रूप में एक संख्या一个数作为最佳猜测
  • e.g. x̄ estimates μजैसे x̄, μ का अनुमान如 x̄ 估计 μ
  • Simple, but shows no uncertaintyआसान, पर अनिश्चितता नहीं दिखाता简单,但不显示不确定性
  • "mean salary = ₹42,000""औसत salary = ₹42,000"“平均工资 = ₹42,000”
Interval estimationInterval estimation区间估计
A rangeएक range一个范围
  • Lower and upper limitsनिचली और ऊपरी सीमा下限和上限
  • Shows the uncertaintyअनिश्चितता दिखाता है显示不确定性
  • Built from the sampling distributionSampling distribution से बनता है基于抽样分布
  • "₹39,500 to ₹44,500""₹39,500 से ₹44,500"“₹39,500 到 ₹44,500”
Confidence levelConfidence level置信水平
90% / 95% / 99%
  • How often the method succeedsतरीका कितनी बार सफल होता है方法成功的频率
  • NOT the chance μ is in one intervalकिसी एक interval में μ होने का chance नहीं不是 μ 落在某个区间内的概率
  • Higher level → wider intervalऊँचा level → चौड़ा interval水平越高 → 区间越宽
  • 95% is the usual convention95% आम परंपरा है95% 是常用惯例
⚠️
The Most Misunderstood Sentence in StatisticsStatistics का सबसे ग़लत समझा जाने वाला वाक्य统计学中最常被误解的一句话

A 95% confidence interval does NOT mean "there is a 95% chance that μ is inside this interval". The true mean μ is fixed. Your interval either contains it or it does not. The 95% means: if we repeated the whole sampling process many times, about 95 out of every 100 intervals would contain μ. The confidence is in the method, not in one interval.

95% confidence interval का मतलब यह नहीं कि "μ के इस interval में होने का chance 95% है"। असली mean μ तय है। आपका interval या तो उसे रखता है या नहीं। 95% का मतलब है: अगर हम पूरी sampling प्रक्रिया कई बार दोहराएँ, तो हर 100 में से लगभग 95 intervals μ को शामिल करेंगे। भरोसा तरीके पर है, किसी एक interval पर नहीं।

95% 置信区间并不表示“μ 落在这个区间内的概率是 95%”。真实均值 μ 是固定的,你的区间要么包含它,要么不包含。95% 的意思是:如果把整个抽样过程重复很多次,每 100 个区间中大约有 95 个会包含 μ。置信度属于方法,而不是某一个区间。


SectionSection第 03 节

Estimation in Pictures — Understand Before the Mathsतस्वीरों में Estimation — गणित से पहले समझें图解估计 — 先理解,再算数

Think of an estimator as an archer. Each sample gives one shot. A good archer hits the centre on average (no bias) and keeps the shots close together (low variance).

Estimator को एक तीरंदाज़ समझें। हर sample एक तीर है। अच्छा तीरंदाज़ औसतन केंद्र पर मारता है (कोई bias नहीं) और तीरों को पास-पास रखता है (कम variance)।

把估计量想象成一名弓箭手。每个样本射出一箭。好弓箭手平均命中靶心(无偏),而且箭彼此靠近(方差小)。

🎯 BIAS vs VARIANCE — FOUR KINDS OF ESTIMATORBIAS vs VARIANCE — चार तरह के ESTIMATOR偏差 vs 方差 — 四种估计量
Bias and variance of an estimator Unbiased + preciseUnbiased + precise无偏 + 精确 the goalलक्ष्य目标 Unbiased, not preciseUnbiased, पर precise नहीं无偏,但不精确 right on average, wide spreadऔसतन सही, बहुत फैला平均正确,但很分散 Biased + preciseBiased + precise有偏 + 精确 tight, but in the wrong placeकसा हुआ, पर ग़लत जगह很集中,但位置错了 Biased, not preciseBiased, precise नहीं有偏,也不精确 the worst caseसबसे बुरा最糟情况 Centre = true parameter (μ). Each dot = the estimate from one sample.केंद्र = असली parameter (μ)। हर dot = एक sample से मिला अनुमान।靶心 = 真实参数(μ)。每个点 = 一个样本得到的估计值。
📐 ANATOMY OF A 95% CONFIDENCE INTERVAL95% CONFIDENCE INTERVAL की बनावट95% 置信区间的结构
Anatomy of a confidence interval x̄ = point estimatex̄ = point estimatex̄ = 点估计 95% 2.5% 2.5% MoE = 1.96 × SE x̄ − MoE x̄ + MoE the confidence intervalconfidence interval置信区间 Curve = where x̄ falls if we repeat the sample (SE = σ/√n).Curve = sample दोहराने पर x̄ कहाँ गिरता है (SE = σ/√n)।曲线 = 重复抽样时 x̄ 落在哪里(SE = σ/√n)。 20 samples → 20 intervals20 samples → 20 intervals20 个样本 → 20 个区间 true μ (fixed, unknown)असली μ (तय, अज्ञात)真实 μ(固定、未知)

Left: the interval is x̄ ± MoE. Right: 20 real samples of n = 25 from a population with μ = 50 — 19 intervals catch μ, one (red) misses. That is what "95%" looks like.

बाएँ: interval = x̄ ± MoE। दाएँ: μ = 50 वाली population से n = 25 के 20 असली samples — 19 intervals μ को पकड़ते हैं, एक (लाल) चूकता है। "95%" ऐसा दिखता है।

左:区间 = x̄ ± MoE。右:从 μ = 50 的总体中抽取的 20 个 n = 25 的真实样本 —— 19 个区间包含 μ,1 个(红色)没有。这就是“95%”的样子。


SectionSection第 04 节

Point Estimation — The Best Single GuessPoint Estimation — सबसे अच्छा एक अनुमान点估计 — 最佳单一猜测

A point estimator is a formula (a statistic) that turns sample data into one number — the best guess of an unknown population parameter. The common ones are:

Point estimator एक formula (statistic) है जो sample data को एक संख्या में बदलता है — अज्ञात population parameter का सबसे अच्छा अनुमान। आम estimators ये हैं:

点估计量是一个公式(统计量),把样本数据变成一个数 —— 对未知总体参数的最佳猜测。常见的有:

Population parameterPopulation parameter总体参数SymbolSymbol符号Point estimatorPoint estimator点估计量FormulaFormula公式
Population meanPopulation mean总体均值μSample meanSample mean样本均值x̄ = Σxᵢ / n
Population variancePopulation variance总体方差σ²Sample varianceSample variance样本方差s² = Σ(xᵢ − x̄)² / (n − 1)
Population SDPopulation SD总体标准差σSample SDSample SD样本标准差s = √s²
Population proportionPopulation proportion总体比例PSample proportionSample proportion样本比例p̂ = x / n

Properties of a good estimatorअच्छे estimator के गुण好估计量的性质

Propertyगुण性质What it meansमतलब含义Exampleउदाहरण例子
UnbiasednessUnbiasedness无偏性On average, the estimator equals the true parameterऔसतन estimator असली parameter के बराबर होता है平均而言,估计量等于真实参数E(x̄) = μ, E(s²) = σ²  unbiasedunbiased无偏
ConsistencyConsistency一致性The estimate gets closer to the truth as n → ∞n → ∞ होने पर अनुमान सच के और पास आता हैn → ∞ 时估计值越来越接近真值x̄ → μ as n growsn बढ़ने पर x̄ → μn 增大时 x̄ → μ
EfficiencyEfficiency有效性The smallest variance among unbiased estimatorsUnbiased estimators में सबसे कम variance无偏估计量中方差最小For normal data, x̄ beats the median: Var(median) ≈ 1.57 × Var(x̄) for large nNormal data में x̄, median से बेहतर: बड़े n पर Var(median) ≈ 1.57 × Var(x̄)对正态数据,x̄ 优于中位数:n 较大时 Var(中位数) ≈ 1.57 × Var(x̄)
SufficiencySufficiency充分性Captures all the information the sample has about the parameterParameter के बारे में sample की सारी जानकारी रखता है包含样本中关于该参数的全部信息x̄ is sufficient for μ in a normal population (σ known)Normal population में (σ ज्ञात) x̄, μ के लिए sufficient है正态总体(σ 已知)中 x̄ 对 μ 是充分的
🎯
Why n − 1 (Bessel's Correction) Makes s² Unbiasedn − 1 (Bessel's Correction) से s² unbiased क्यों बनता है为什么除以 n − 1(贝塞尔校正)能让 s² 无偏

We measure deviations from the sample mean x̄, not the true mean μ. The sample mean always sits in the middle of its own data, so the deviations come out a little too small. Dividing by n would underestimate σ² by the factor (n − 1)/n. Dividing by n − 1 fixes this exactly, so E(s²) = σ². Careful: s itself is still slightly biased low (for n = 5, about 6% too small on average). That is normal and accepted — the t-interval already allows for it.

हम deviations sample mean x̄ से नापते हैं, असली mean μ से नहीं। Sample mean हमेशा अपने data के बीच में होता है, इसलिए deviations थोड़े छोटे आते हैं। n से भाग देने पर σ² का (n − 1)/n गुना कम अनुमान आता है। n − 1 से भाग देना इसे ठीक कर देता है, यानी E(s²) = σ²। ध्यान दें: s ख़ुद अब भी थोड़ा नीचे की ओर biased है (n = 5 पर औसतन लगभग 6% छोटा)। यह सामान्य और स्वीकार्य है — t-interval इसका ध्यान पहले से रखता है।

我们是从样本均值 x̄ 而不是真实均值 μ 计算偏差的。样本均值总在自己数据的中间,所以偏差会偏小一点。除以 n 会把 σ² 低估为 (n − 1)/n 倍。除以 n − 1 正好修正了这一点,使 E(s²) = σ²。注意:s 本身仍略微偏低(n = 5 时平均约小 6%)。这是正常的、可以接受的 —— t 区间已经考虑了这一点。

import numpy as np

# Check bias: 100,000 samples of n = 5 from a population with σ = 10 (σ² = 100)
rng = np.random.default_rng(1)
X = rng.normal(50, 10, size=(100_000, 5))

print(f"Average s² with ddof=0 (÷ n)    : {X.var(axis=1, ddof=0).mean():6.2f}   (true σ² = 100)")
print(f"Average s² with ddof=1 (÷ n − 1): {X.var(axis=1, ddof=1).mean():6.2f}   (true σ² = 100)")
print(f"Average s  with ddof=1          : {X.std(axis=1, ddof=1).mean():6.2f}   (true σ  = 10)")
OUTPUT
Average s² with ddof=0 (÷ n) : 79.81 (true σ² = 100) Average s² with ddof=1 (÷ n − 1): 99.76 (true σ² = 100) Average s with ddof=1 : 9.39 (true σ = 10)
LIVELIVE互动Estimator Lab — Bias and SpreadEstimator Lab — Bias और फैलाव估计量实验室 — 偏差与离散

Population: normal with μ = 50, σ = 10 (σ² = 100). Pick an estimator and n, then draw samples. The blue line is the true value; the amber dashed line is the average of all estimates. If they match, the estimator is unbiased. A narrower histogram means a more efficient estimator.

Population: normal, μ = 50, σ = 10 (σ² = 100)। एक estimator और n चुनें, फिर samples निकालें। नीली line असली value है; नारंगी dashed line सारे अनुमानों का औसत है। दोनों मिलें तो estimator unbiased है। पतला histogram मतलब ज़्यादा efficient estimator.

总体:正态分布,μ = 50,σ = 10(σ² = 100)。选择一个估计量和 n,然后抽样。蓝线是真实值;橙色虚线是所有估计值的平均。两者重合就说明无偏。直方图越窄,估计量越有效。


SectionSection第 05 节

Interval Estimation & Confidence Intervals ⭐Interval Estimation और Confidence Intervals ⭐区间估计与置信区间 ⭐

A point estimate is useful but incomplete. It gives the best guess but says nothing about how uncertain that guess is. A mean salary of ₹42,000 from 10 workers is much less reliable than ₹42,000 from 10,000 workers. An interval estimate shows this by giving a range of believable values for the parameter.

Point estimate उपयोगी है, पर अधूरा। यह सबसे अच्छा अनुमान देता है, पर यह नहीं बताता कि अनुमान कितना अनिश्चित है। 10 workers से मिली ₹42,000 की औसत salary, 10,000 workers से मिली ₹42,000 से बहुत कम भरोसेमंद है। Interval estimate parameter के लिए भरोसेमंद values की range देकर यह दिखाता है।

点估计有用,但不完整。它给出最佳猜测,却没说这个猜测有多不确定。从 10 名工人得到的平均工资 ₹42,000,远不如从 10,000 名工人得到的 ₹42,000 可靠。区间估计通过给出参数的可信数值范围来体现这一点。

Confidence interval — σ known (z-interval)Confidence interval — σ ज्ञात (z-interval)置信区间 —— σ 已知(z 区间)
CI = x̄ ± z* × (σ / √n)
Use only when the population SD σ is truly known (rare). z* = 1.645 for 90%, 1.960 for 95%, 2.576 for 99%.
सिर्फ़ तब इस्तेमाल करें जब population SD σ सच में ज्ञात हो (बहुत कम)। 90% के लिए z* = 1.645, 95% के लिए 1.960, 99% के लिए 2.576।
只在总体标准差 σ 确实已知时使用(很少见)。90% 对应 z* = 1.645,95% 对应 1.960,99% 对应 2.576。
Confidence interval — σ unknown (t-interval)Confidence interval — σ अज्ञात (t-interval)置信区间 —— σ 未知(t 区间)
CI = x̄ ± t* × (s / √n)
Use when σ is unknown and estimated by s — almost always. t* comes from the t-distribution with df = n − 1. t* is bigger than z* for small n and gets close to z* as n grows (n = 100: 1.984 vs 1.960).
जब σ अज्ञात हो और s से अनुमानित हो — लगभग हमेशा। t* आता है t-distribution से, df = n − 1 के साथ। छोटे n पर t*, z* से बड़ा होता है और n बढ़ने पर z* के पास आता है (n = 100: 1.984 vs 1.960)।
当 σ 未知、用 s 估计时使用 —— 几乎总是这样。t* 来自自由度 df = n − 1 的 t 分布。n 小时 t* 大于 z*,随 n 增大接近 z*(n = 100 时:1.984 对 1.960)。
📏 CRITICAL z* VALUES FOR COMMON CONFIDENCE LEVELSआम CONFIDENCE LEVELS के लिए CRITICAL z* VALUES常用置信水平的临界值 z*
Critical z values 90% confidence90% confidence90% 置信 -1.645 +1.645 90% 5% in each red tailहर लाल tail में 5%每个红色尾部 5% 95% confidence95% confidence95% 置信 -1.960 +1.960 95% 2.5% in each red tailहर लाल tail में 2.5%每个红色尾部 2.5% 99% confidence99% confidence99% 置信 -2.576 +2.576 99% 0.5% in each red tailहर लाल tail में 0.5%每个红色尾部 0.5%
📐
The Confidence–Width Trade-offConfidence और चौड़ाई का सौदा置信度与宽度的权衡

A higher confidence level gives a wider interval. A 100% interval for a normal mean would run from −∞ to +∞ — perfectly sure and completely useless. The skill is to pick a level that is trustworthy (often 95%) while keeping the interval narrow enough to act on.

ऊँचा confidence level चौड़ा interval देता है। Normal mean के लिए 100% interval −∞ से +∞ तक होगा — पूरी तरह पक्का और पूरी तरह बेकार। हुनर यह है कि भरोसेमंद level चुनें (अक्सर 95%) और interval को फ़ैसले लायक़ पतला रखें।

置信水平越高,区间越宽。正态均值的 100% 区间会从 −∞ 到 +∞ —— 完全确定,却毫无用处。关键是选择一个可信的水平(通常 95%),同时让区间窄到足以指导行动。

LIVELIVE互动Confidence-Interval BuilderConfidence-Interval Builder置信区间构建器

The LED example: x̄ = 1,480 hours. Change n, s and the confidence level. Watch t*, SE and the interval change, and compare the t-interval with a z-interval. Does the interval stay above the 1,400-hour guarantee?

LED उदाहरण: x̄ = 1,480 घंटे। n, s और confidence level बदलें। t*, SE और interval को बदलते देखें, और t-interval की z-interval से तुलना करें। क्या interval 1,400 घंटे की guarantee से ऊपर रहता है?

LED 例子:x̄ = 1,480 小时。调整 n、s 和置信水平,观察 t*、SE 和区间的变化,并比较 t 区间与 z 区间。区间是否一直高于 1,400 小时的保证?

c


SectionSection第 06 节

Margin of Error — The ± Number Everyone SeesMargin of Error — वह ± संख्या जो सब देखते हैं误差范围 — 人人都见过的 ± 数字

The margin of error (MoE) is half the width of a confidence interval. It is the ±3% in election polls and the "± x" next to many lab results. It tells you how far the point estimate might reasonably be from the true value, in either direction. It covers random sampling error only — not bias from a bad sample or badly worded questions.

Margin of error (MoE) confidence interval की आधी चौड़ाई है। यह election polls का ±3% है और कई lab results के आगे लिखा "± x"। यह बताता है कि point estimate असली value से किसी भी दिशा में कितना दूर हो सकता है। यह सिर्फ़ random sampling error को कवर करता है — ख़राब sample या ग़लत ढंग से पूछे गए सवालों से आए bias को नहीं।

误差范围(MoE)是置信区间宽度的一半。它就是选举民调里的 ±3%,以及许多化验结果后面的“± x”。它告诉你点估计在两个方向上可能偏离真值多远。它只涵盖随机抽样误差 —— 不包括坏样本或问题措辞不当造成的偏差。

Margin of error (mean)Margin of error (mean)误差范围(均值)
MoE = t* × (s / √n)
For a population mean; the interval is x̄ ± MoE. Use z* × σ/√n only if σ is truly known.
Population mean के लिए; interval = x̄ ± MoE। z* × σ/√n सिर्फ़ तब, जब σ सच में ज्ञात हो।
用于总体均值;区间为 x̄ ± MoE。只有 σ 确实已知时才用 z* × σ/√n。
Margin of error (proportion)Margin of error (proportion)误差范围(比例)
MoE = z* × √[ p̂(1 − p̂) / n ]
For a population proportion — polls, A/B tests, defect rates. The interval is p̂ ± MoE. The MoE is largest at p̂ = 0.5.
Population proportion के लिए — polls, A/B tests, defect rates. Interval = p̂ ± MoE. p̂ = 0.5 पर MoE सबसे बड़ा होता है।
用于总体比例 —— 民调、A/B 测试、次品率。区间为 p̂ ± MoE。p̂ = 0.5 时 MoE 最大。
📉 HOW SAMPLE SIZE CHANGES THE MARGIN OF ERRORSAMPLE SIZE से MARGIN OF ERROR कैसे बदलता है样本量如何改变误差范围
Margin of error vs sample size ±0% ±5% ±10% ±15% ±20% 0 250 500 1,000 1,500 2,000 Sample size n (worst case p̂ = 0.5, 95% confidence)Sample size n (सबसे बुरा case p̂ = 0.5, 95% confidence)样本量 n(最坏情况 p̂ = 0.5,95% 置信) n=25: ±19.6% n=50: ±13.9% n=100: ±9.8% n=400: ±4.9% n=1,000: ±3.1% n=1,600: ±2.45% Diminishing returnsघटता फ़ायदा收益递减 To halve the MoE, multiply n by 4.MoE आधा करने के लिए n को 4 गुना करें।要把 MoE 减半,n 要乘以 4。 n = 400 → 1,600 cuts ±4.9% to ±2.45%n = 400 → 1,600: ±4.9% से ±2.45%n = 400 → 1,600:±4.9% 降到 ±2.45%
💡
The Square-Root Law — Why Many Polls Use About 1,000 PeopleSquare-Root Law — कई polls लगभग 1,000 लोग क्यों लेते हैं平方根定律 — 为什么很多民调只问约 1,000 人

For a proportion at 95% confidence and the worst case p̂ = 0.5, MoE = 1.96 × 0.5 / √n ≈ 1/√n. At n = 1,000 the MoE is about ±3.1% — good enough for most questions at a fair cost. At n = 10,000 it is about ±1.0%: 10 times the people, but only about 3 times the precision. That is why many national polls use roughly 1,000–2,000 people. Beyond that, cost grows much faster than precision.

95% confidence और सबसे बुरे case p̂ = 0.5 पर proportion के लिए MoE = 1.96 × 0.5 / √n ≈ 1/√n। n = 1,000 पर MoE लगभग ±3.1% है — ठीक-ठाक ख़र्च पर ज़्यादातर सवालों के लिए काफ़ी। n = 10,000 पर यह लगभग ±1.0% है: 10 गुना लोग, पर precision सिर्फ़ लगभग 3 गुना। इसीलिए कई national polls लगभग 1,000–2,000 लोग लेते हैं। उसके आगे ख़र्च precision से बहुत तेज़ बढ़ता है।

对于比例,在 95% 置信水平、最坏情况 p̂ = 0.5 时,MoE = 1.96 × 0.5 / √n ≈ 1/√n。n = 1,000 时 MoE 约为 ±3.1% —— 以合理成本足以回答大多数问题。n = 10,000 时约为 ±1.0%:人数多 10 倍,精度只提高约 3 倍。这就是为什么很多全国性民调只用大约 1,000–2,000 人。再往上,成本增长远快于精度。

LIVELIVE互动Poll Simulator — Margin of Error in ActionPoll Simulator — Margin of Error का असर民调模拟器 — 误差范围实战

Set the true support p and the poll size n. The top chart shows the MoE for every n. The bottom chart runs 20 real polls: each bar is p̂ ± MoE. Red bars missed the true p.

असली support p और poll size n चुनें। ऊपर का chart हर n के लिए MoE दिखाता है। नीचे का chart 20 असली polls चलाता है: हर bar p̂ ± MoE है। लाल bars असली p से चूक गए।

设置真实支持率 p 和民调人数 n。上图显示每个 n 对应的 MoE。下图进行 20 次真实民调:每条线是 p̂ ± MoE。红线没有包含真实的 p。

c


SectionSection第 07 节

Step by Step: Building a Confidence IntervalStep by Step: Confidence Interval बनाना一步一步构建置信区间

A quality engineer tests 36 LED bulbs from a production line and records how many hours each lasts. She wants a 95% confidence interval for the true average lifespan of all bulbs the line makes.

एक quality engineer production line से 36 LED bulbs जाँचती है और हर bulb कितने घंटे चला, यह लिखती है। उसे line के सभी bulbs की असली औसत उम्र के लिए 95% confidence interval चाहिए।

一位质量工程师从生产线上抽取 36 只 LED 灯泡,记录每只能用多少小时。她想为这条线生产的所有灯泡的真实平均寿命构建一个 95% 置信区间。

Sample dataSample data样本数据ValueValue数值
Sample size (n)Sample size (n)样本量(n)36 bulbs36 bulbs36 只
Sample mean (x̄)Sample mean (x̄)样本均值(x̄)1,480 hours1,480 घंटे1,480 小时
Sample SD (s)Sample SD (s)样本标准差(s)120 hours120 घंटे120 小时
Confidence levelConfidence level置信水平95%
σ (population SD)σ (population SD)σ(总体标准差)Unknown → use the t-intervalअज्ञात → t-interval इस्तेमाल करें未知 → 用 t 区间
🧮 Building the 95% Confidence Interval95% Confidence Interval बनाना构建 95% 置信区间
Step 1Step 1第 1 步
Find the critical value t*.
Degrees of freedom df = n − 1 = 36 − 1 = 35.
For 95% with df = 35: t* = 2.030 (t-table, or scipy.stats.t.ppf(0.975, df=35)).
Critical value t* निकालें।
Degrees of freedom df = n − 1 = 36 − 1 = 35.
95% और df = 35 के लिए: t* = 2.030 (t-table, या scipy.stats.t.ppf(0.975, df=35))।
求临界值 t*。
自由度 df = n − 1 = 36 − 1 = 35。
95%、df = 35 时:t* = 2.030(查 t 表,或 scipy.stats.t.ppf(0.975, df=35))。
Step 2Step 2第 2 步
Find the standard error (SE).
SE = s / √n = 120 / √36 = 120 / 6 = 20 hours
Standard error (SE) निकालें।
SE = s / √n = 120 / √36 = 120 / 6 = 20 घंटे
求标准误(SE)。
SE = s / √n = 120 / √36 = 120 / 6 = 20 小时
Step 3Step 3第 3 步
Find the margin of error (MoE).
MoE = t* × SE = 2.030 × 20 = 40.6 hours
Margin of error (MoE) निकालें।
MoE = t* × SE = 2.030 × 20 = 40.6 घंटे
求误差范围(MoE)。
MoE = t* × SE = 2.030 × 20 = 40.6 小时
Step 4Step 4第 4 步
Build the interval.
Lower = 1,480 − 40.6 = 1,439.4 hours
Upper = 1,480 + 40.6 = 1,520.6 hours
95% CI = (1,439.4, 1,520.6) hours
Interval बनाएँ।
Lower = 1,480 − 40.6 = 1,439.4 घंटे
Upper = 1,480 + 40.6 = 1,520.6 घंटे
95% CI = (1,439.4, 1,520.6) घंटे
构建区间。
下限 = 1,480 − 40.6 = 1,439.4 小时
上限 = 1,480 + 40.6 = 1,520.6 小时
95% 置信区间 = (1,439.4, 1,520.6) 小时
Meaningमतलब解读
We are 95% confident that the true mean lifespan of all bulbs is between about 1,439 and 1,521 hours. If the guarantee is an average of 1,400 hours, the whole interval is above it — good evidence the average is met. It says nothing about single bulbs: with s = 120, many individual bulbs will still last less than 1,400 hours.
हमें 95% भरोसा है कि सभी bulbs की असली औसत उम्र लगभग 1,439 और 1,521 घंटों के बीच है। अगर guarantee 1,400 घंटे के औसत की है, तो पूरा interval उससे ऊपर है — औसत पूरा होने का अच्छा सबूत। यह अलग-अलग bulbs के बारे में कुछ नहीं कहता: s = 120 के साथ कई bulbs फिर भी 1,400 घंटे से कम चलेंगे।
我们有 95% 的把握认为所有灯泡的真实平均寿命在约 1,439 到 1,521 小时之间。如果保证的是平均 1,400 小时,整个区间都在其上方 —— 是平均寿命达标的有力证据。但它不涉及单只灯泡:s = 120 时,仍有不少灯泡寿命低于 1,400 小时。
✅
What Makes the Interval Narrower or Wider?Interval पतला या चौड़ा किससे होता है?什么让区间变窄或变宽?

Narrower (more precise): larger n, smaller s, lower confidence level.
Wider (less precise): smaller n, larger s, higher confidence level.
The lever you control best is usually sample size. Doubling n shrinks the MoE by √2 ≈ 1.41; you need 4 × n to halve it. Try it in the builder above.

पतला (ज़्यादा सटीक): बड़ा n, छोटा s, कम confidence level.
चौड़ा (कम सटीक): छोटा n, बड़ा s, ऊँचा confidence level.
आपके हाथ में सबसे अच्छा lever आम तौर पर sample size है। n दोगुना करने से MoE √2 ≈ 1.41 गुना घटता है; आधा करने के लिए 4 × n चाहिए। ऊपर के builder में आज़माएँ।

更窄(更精确):n 更大、s 更小、置信水平更低。
更宽(不够精确):n 更小、s 更大、置信水平更高。
你最能控制的通常是样本量。n 翻倍,MoE 只缩小 √2 ≈ 1.41 倍;要减半需要 4 × n。在上面的构建器里试试。


SectionSection第 08 节

Python ImplementationPython ImplementationPython 实现

Point estimationPoint estimation点估计

import numpy as np
from scipy import stats

np.random.seed(42)

# Sample: lifespan of 36 LED bulbs (hours)
sample = np.random.normal(loc=1480, scale=120, size=36)

# Point estimates
x_bar = np.mean(sample)             # estimates μ
s     = np.std(sample, ddof=1)      # estimates σ (n − 1 in the denominator)
n     = len(sample)

print(f"Point estimate of μ (sample mean x̄): {x_bar:.2f} hrs")
print(f"Point estimate of σ (sample std  s):  {s:.2f} hrs")
print(f"Sample size n: {n}")
OUTPUT
Point estimate of μ (sample mean x̄): 1460.46 hrs Point estimate of σ (sample std s): 112.34 hrs Sample size n: 36

This simulated sample happens to have x̄ = 1,460.46 and s = 112.34 — not exactly the 1,480 and 120 used to create it. That gap is sampling error, and it is exactly why we need intervals.

इस simulated sample में x̄ = 1,460.46 और s = 112.34 आए — ठीक वही 1,480 और 120 नहीं जिनसे यह बना था। यह अंतर sampling error है, और इसीलिए हमें intervals चाहिए।

这个模拟样本恰好得到 x̄ = 1,460.46、s = 112.34 —— 并不正好等于生成它时用的 1,480 和 120。这个差距就是抽样误差,也正是我们需要区间的原因。

Confidence interval with the SciPy t-distributionSciPy t-distribution से Confidence interval用 SciPy 的 t 分布求置信区间

from scipy import stats
import numpy as np

np.random.seed(42)
sample = np.random.normal(loc=1480, scale=120, size=36)

x_bar = np.mean(sample)
s     = np.std(sample, ddof=1)
n     = len(sample)
se    = s / np.sqrt(n)

# 95% and 99% CI using the t-distribution (σ unknown)
# (SciPy ≥ 1.9 uses 'confidence='; older versions used 'alpha=')
ci_95 = stats.t.interval(confidence=0.95, df=n-1, loc=x_bar, scale=se)
ci_99 = stats.t.interval(confidence=0.99, df=n-1, loc=x_bar, scale=se)

# Critical t* values
t_95 = stats.t.ppf(0.975, df=n-1)
t_99 = stats.t.ppf(0.995, df=n-1)

print(f"Standard Error (SE): {se:.2f} hrs")
print(f"t* for 95% CI (df={n-1}): {t_95:.4f}")
print(f"Margin of Error 95%: ±{t_95 * se:.2f} hrs")
print(f"95% CI: ({ci_95[0]:.2f}, {ci_95[1]:.2f}) hrs")
print(f"99% CI: ({ci_99[0]:.2f}, {ci_99[1]:.2f}) hrs")
OUTPUT
Standard Error (SE): 18.72 hrs t* for 95% CI (df=35): 2.0301 Margin of Error 95%: ±38.01 hrs 95% CI: (1422.44, 1498.47) hrs 99% CI: (1409.46, 1511.46) hrs

The 95% interval (1,422.44, 1,498.47) contains the true mean of 1,480 that we used to generate the data.

95% interval (1,422.44, 1,498.47) में वह असली mean 1,480 है जिससे data बनाया गया।

95% 区间 (1,422.44, 1,498.47) 包含了生成数据时使用的真实均值 1,480。

Confidence interval for a proportionProportion के लिए Confidence interval比例的置信区间

import numpy as np
from scipy import stats

# Scenario: 420 out of 1,000 voters prefer Party A
n       = 1000
x       = 420          # successes
p_hat   = x / n        # 0.42

se_prop = np.sqrt(p_hat * (1 - p_hat) / n)

# 95% CI for a proportion (normal approximation — n is large)
z_star = stats.norm.ppf(0.975)           # 1.95996...
moe    = z_star * se_prop
ci_low = p_hat - moe
ci_hi  = p_hat + moe

print(f"Sample proportion p̂:    {p_hat:.4f} ({p_hat*100:.1f}%)")
print(f"Standard Error:          {se_prop:.4f}")
print(f"Critical z*:             {z_star:.4f}")
print(f"Margin of Error:         ±{moe:.4f} (±{moe*100:.2f}%)")
print(f"95% CI: ({ci_low*100:.2f}%, {ci_hi*100:.2f}%)")
OUTPUT
Sample proportion p̂: 0.4200 (42.0%) Standard Error: 0.0156 Critical z*: 1.9600 Margin of Error: ±0.0306 (±3.06%) 95% CI: (38.94%, 45.06%)
⚠️
Small Samples or Extreme p̂? Use the Wilson Intervalछोटा Sample या बहुत छोटा/बड़ा p̂? Wilson Interval इस्तेमाल करें样本小或 p̂ 极端?用 Wilson 区间

The simple formula p̂ ± z*√[p̂(1 − p̂)/n] (the Wald interval) works well for large n with p̂ not near 0 or 1. A common check: at least about 10 successes and 10 failures. For small samples it can even give impossible values below 0%. The Wilson interval fixes this:

आसान formula p̂ ± z*√[p̂(1 − p̂)/n] (Wald interval) बड़े n पर ठीक चलता है, जब p̂ 0 या 1 के पास न हो। आम जाँच: कम से कम लगभग 10 successes और 10 failures। छोटे samples में यह 0% से नीचे जैसी असंभव values भी दे सकता है। Wilson interval इसे ठीक करता है:

简单公式 p̂ ± z*√[p̂(1 − p̂)/n](Wald 区间)在 n 大、p̂ 不接近 0 或 1 时效果好。常用检查:成功和失败至少各约 10 次。样本小时,它甚至会给出低于 0% 这样不可能的值。Wilson 区间解决了这个问题:

import numpy as np
from scipy import stats

z_star = stats.norm.ppf(0.975)    # 1.96 for a 95% CI

def wald(x, n):
    p = x / n
    m = z_star * np.sqrt(p * (1 - p) / n)
    return p - m, p + m

def wilson(x, n):
    p, z2 = x / n, z_star ** 2
    centre = (p + z2 / (2 * n)) / (1 + z2 / n)
    half = z_star * np.sqrt(p * (1 - p) / n + z2 / (4 * n * n)) / (1 + z2 / n)
    return centre - half, centre + half

# Small sample: 2 defective items out of 25 checked
for name, f in [("Wald  ", wald), ("Wilson", wilson)]:
    lo, hi = f(2, 25)
    print(f"{name} 95% CI: ({lo*100:6.2f}%, {hi*100:6.2f}%)")
OUTPUT
Wald 95% CI: ( -2.63%, 18.63%) Wilson 95% CI: ( 2.22%, 24.97%)

Required sample sizeज़रूरी sample size所需样本量

import numpy as np
from scipy import stats

z_star = stats.norm.ppf(0.975)    # 1.96 for a 95% CI

# Mean: how many bulbs for MoE ≤ 25 hours?
sigma       = 120                 # guess of σ from a pilot study
desired_moe = 25
n_mean = (z_star * sigma / desired_moe) ** 2
print(f"Required n for MoE ≤ 25 hrs: n ≥ {np.ceil(n_mean):.0f}")

# Proportion: worst case p̂ = 0.5
for moe in [0.05, 0.03, 0.02, 0.01]:
    n_prop = (z_star * 0.5 / moe) ** 2
    print(f"Required n for ±{moe*100:.0f}% poll: n ≥ {np.ceil(n_prop):,.0f}")
OUTPUT
Required n for MoE ≤ 25 hrs: n ≥ 89 Required n for ±5% poll: n ≥ 385 Required n for ±3% poll: n ≥ 1,068 Required n for ±2% poll: n ≥ 2,401 Required n for ±1% poll: n ≥ 9,604

Notice the square-root law again: going from ±2% to ±1% needs four times as many people (2,401 → 9,604).

Square-root law फिर देखें: ±2% से ±1% पर जाने के लिए चार गुना लोग चाहिए (2,401 → 9,604)।

再次看到平方根定律:从 ±2% 到 ±1% 需要四倍的人数(2,401 → 9,604)。

Does "95%" really hold? A coverage checkक्या "95%" सच में सही है? Coverage check“95%”真的成立吗?覆盖率检验

import numpy as np
from scipy import stats

# Does the "95%" really hold? Repeat a study 10,000 times.
rng = np.random.default_rng(0)
mu, sigma, n, reps = 1480, 120, 10, 10_000

hits = {"t-interval (correct)": 0, "z* with s (wrong for small n)": 0}
t_star, z_star = stats.t.ppf(0.975, n - 1), stats.norm.ppf(0.975)
for _ in range(reps):
    x = rng.normal(mu, sigma, n)
    m, se = x.mean(), x.std(ddof=1) / np.sqrt(n)
    hits["t-interval (correct)"] += abs(m - mu) <= t_star * se
    hits["z* with s (wrong for small n)"] += abs(m - mu) <= z_star * se

for k, v in hits.items():
    print(f"{k:31s}: {v / reps * 100:.1f}% of intervals caught μ")
OUTPUT
t-interval (correct) : 94.9% of intervals caught μ z* with s (wrong for small n) : 91.9% of intervals caught μ

With n = 10, the correct t-interval catches μ 94.9% of the time. Using z* = 1.96 with s gives intervals that are too narrow, and they catch μ only 91.9% of the time — a "95%" interval that is really about 92%. Try it yourself:

n = 10 पर सही t-interval 94.9% बार μ पकड़ता है। s के साथ z* = 1.96 लेने से intervals बहुत पतले बनते हैं, और वे सिर्फ़ 91.9% बार μ पकड़ते हैं — "95%" interval जो असल में लगभग 92% है। ख़ुद आज़माएँ:

n = 10 时,正确的 t 区间有 94.9% 的时候包含 μ。用 s 配 z* = 1.96 得到的区间太窄,只有 91.9% 的时候包含 μ —— 名为“95%”,实际约 92%。自己试试:

LIVELIVE互动Coverage Lab — Is Your 95% Really 95%?Coverage Lab — क्या आपका 95% सच में 95% है?覆盖率实验室 — 你的 95% 真的是 95% 吗?

Each line is a 95% interval from a new sample of n values (μ = 50, σ = 10). Blue lines catch μ; red lines miss. Compare the three methods at small n (try n = 3 to 5), then raise n.

हर line n values के नए sample से बना 95% interval है (μ = 50, σ = 10)। नीली lines μ पकड़ती हैं; लाल चूकती हैं। छोटे n पर (n = 3 से 5 आज़माएँ) तीनों तरीकों की तुलना करें, फिर n बढ़ाएँ।

每条线是由一个新的 n 个数值的样本得到的 95% 区间(μ = 50,σ = 10)。蓝线包含 μ;红线没有。先在小 n(试试 n = 3 到 5)下比较三种方法,再增大 n。

⚠️
t-interval vs z-interval — When to Use Whicht-interval vs z-interval — कब कौन साt 区间 vs z 区间 — 何时用哪个

Mean, σ unknown (you use s): use the t-interval, at any n. For large n it gives almost the same answer as z, so nothing is lost.
Mean, σ truly known: the z-interval is fine (rare in practice).
Proportion: use z (Wald) for large samples, or Wilson for small samples or p̂ near 0 or 1.
The t-interval assumes roughly normal data or a large enough n. For small, very skewed samples, consider a bootstrap interval instead.

Mean, σ अज्ञात (आप s इस्तेमाल करते हैं): किसी भी n पर t-interval लें। बड़े n पर यह z जैसा ही जवाब देता है, तो कुछ नहीं खोते।
Mean, σ सच में ज्ञात: z-interval ठीक है (असल में कम होता है)।
Proportion: बड़े samples में z (Wald), छोटे samples या 0/1 के पास p̂ पर Wilson.
t-interval मानता है कि data लगभग normal है या n काफ़ी बड़ा है। छोटे, बहुत skewed samples में bootstrap interval पर विचार करें।

均值,σ 未知(用 s):任何 n 都用 t 区间。n 大时它与 z 的结果几乎相同,没有损失。
均值,σ 确实已知:可用 z 区间(实际很少见)。
比例:大样本用 z(Wald),小样本或 p̂ 接近 0 或 1 时用 Wilson。
t 区间假设数据大致正态或 n 足够大。对于小而严重偏斜的样本,可考虑自助法(bootstrap)区间。


SectionSection第 09 节

Estimation Methods — Comparison TablesEstimation Methods — तुलना Tables估计方法 — 对照表

Propertyगुण性质Point estimationPoint estimation点估计Interval estimation (CI)Interval estimation (CI)区间估计(置信区间)
OutputOutput输出One number (x̄, p̂, s)एक संख्या (x̄, p̂, s)一个数(x̄、p̂、s)A range (lower, upper)एक range (lower, upper)一个范围(下限,上限)
Shows uncertainty?अनिश्चितता दिखाता है?显示不确定性?Noनहीं否Yesहाँ是
Easy to communicate?समझाना आसान?容易沟通?Very easyबहुत आसान非常容易Needs explanationसमझाना पड़ता है需要解释
Reflects sample size?Sample size दिखता है?体现样本量?No — 10 or 10,000 look the sameनहीं — 10 और 10,000 एक जैसे दिखते हैं否 —— 10 和 10,000 看起来一样Yes — through SE = s/√nहाँ — SE = s/√n से是 —— 通过 SE = s/√n
Useful for decisions?फ़ैसलों में उपयोगी?对决策有用?Partlyकुछ हद तक部分Yesहाँ是
Link to hypothesis testsHypothesis tests से संबंध与假设检验的关系Used inside the test statisticTest statistic के अंदर इस्तेमाल用于检验统计量A 95% CI that excludes a value ⇔ a two-sided test at α = 0.05 rejects it (same method)जो 95% CI किसी value को बाहर रखे ⇔ α = 0.05 पर two-sided test उसे reject करता है (वही तरीका)95% 置信区间不包含某值 ⇔ α = 0.05 的双侧检验拒绝该值(同一方法)
Confidence levelConfidence level置信水平z*z*z*αααTail area each sideहर तरफ़ tail area每侧尾部面积Typical useआम इस्तेमाल典型用途
90%1.6450.105%Early or exploratory studiesशुरुआती या exploratory studies早期或探索性研究
95%1.9600.052.5%Most common conventionसबसे आम परंपरा最常用的惯例
99%2.5760.010.5%Medical and high-stakes decisionsMedical और बड़े जोखिम वाले फ़ैसले医疗和高风险决策
99.9%3.2910.0010.05%When a wrong claim is very costlyजब ग़लत दावा बहुत महँगा हो错误结论代价极高时

SectionSection第 10 节

Golden RulesGolden Rules黄金法则

🎯 Estimation Theory — Key RulesEstimation Theory — मुख्य नियम估计理论 — 关键规则
1
Always report a CI with a point estimate. A sample mean without an interval is like a weather forecast without a range. The interval tells readers how much to trust the number.
Point estimate के साथ हमेशा CI बताएँ। बिना interval का sample mean, बिना range के मौसम पूर्वानुमान जैसा है। Interval बताता है कि संख्या पर कितना भरोसा करें।
报告点估计时一定附上置信区间。没有区间的样本均值,就像没有范围的天气预报。区间告诉读者该多大程度相信这个数。
2
"95% confident" means the method works 95% of the time — not that this interval has a 95% chance of containing μ. μ is fixed. Once computed, an interval either contains μ or it does not.
"95% confident" का मतलब है तरीका 95% बार सफल होता है — यह नहीं कि इस interval में μ होने का chance 95% है। μ तय है। बनने के बाद interval या तो μ रखता है या नहीं।
“95% 置信”指方法 95% 的时候有效 —— 不是说这个区间有 95% 的概率包含 μ。μ 是固定的。区间一旦算出,要么包含 μ,要么不包含。
3
Use the t-interval for a mean whenever σ is unknown — at any sample size. In Python: stats.t.interval(confidence=0.95, df=n-1, loc=x_bar, scale=s/np.sqrt(n)). For large n it matches z anyway.
σ अज्ञात हो तो mean के लिए t-interval लें — किसी भी sample size पर। Python में: stats.t.interval(confidence=0.95, df=n-1, loc=x_bar, scale=s/np.sqrt(n))। बड़े n पर यह वैसे भी z से मिलता है।
只要 σ 未知,均值就用 t 区间 —— 无论样本多大。Python 中:stats.t.interval(confidence=0.95, df=n-1, loc=x_bar, scale=s/np.sqrt(n))。n 大时它本来就和 z 一致。
4
To halve the margin of error, multiply the sample size by 4. MoE ∝ 1/√n. Doubling n cuts the MoE only by √2 ≈ 1.41. Precision is expensive.
Margin of error आधा करने के लिए sample size 4 गुना करें। MoE ∝ 1/√n। n दोगुना करने से MoE सिर्फ़ √2 ≈ 1.41 गुना घटता है। Precision महँगी है।
要把误差范围减半,样本量要乘以 4。MoE ∝ 1/√n。n 翻倍只让 MoE 缩小 √2 ≈ 1.41 倍。精度很昂贵。
5
Use ddof=1 for sample variance and SD. np.std(data, ddof=1) divides by n − 1, which makes s² unbiased (s is still slightly low, and that is fine). ddof=0 makes s smaller and the interval too narrow — falsely precise.
Sample variance और SD के लिए ddof=1 लें। np.std(data, ddof=1) n − 1 से भाग देता है, जिससे s² unbiased बनता है (s अब भी थोड़ा कम है, और वह ठीक है)। ddof=0 से s छोटा बनता है और interval बहुत पतला — झूठी precision.
样本方差和标准差用 ddof=1。np.std(data, ddof=1) 除以 n − 1,使 s² 无偏(s 仍略偏小,这没关系)。ddof=0 会让 s 偏小、区间太窄 —— 虚假的精确。
6
Work out the sample size before collecting data — not after. Use n = (z* × σ / MoE)² for a mean, or n = z*² × p(1 − p) / MoE² for a proportion (p = 0.5 if unknown). Finding out afterwards that the CI is too wide wastes time and money.
Data जुटाने से पहले sample size निकालें — बाद में नहीं। Mean के लिए n = (z* × σ / MoE)², proportion के लिए n = z*² × p(1 − p) / MoE² (p अज्ञात हो तो 0.5)। बाद में पता चलना कि CI बहुत चौड़ा है, समय और पैसा बर्बाद करता है।
在收集数据之前算好样本量 —— 而不是之后。均值用 n = (z* × σ / MoE)²,比例用 n = z*² × p(1 − p) / MoE²(p 未知时取 0.5)。事后才发现区间太宽,会浪费时间和金钱。
7
The margin of error covers random error only — not bias. A poll of 10,000 people from a biased list still gets the wrong answer, just with a small ±. Check how the sample was chosen before trusting any interval.
Margin of error सिर्फ़ random error कवर करता है — bias नहीं। Biased list से 10,000 लोगों का poll भी ग़लत जवाब देगा, बस छोटे ± के साथ। किसी interval पर भरोसा करने से पहले जाँचें कि sample कैसे चुना गया।
误差范围只涵盖随机误差 —— 不包括偏差。从有偏名单中抽 10,000 人的民调照样会得出错误答案,只是 ± 很小。相信任何区间之前,先检查样本是怎么选的。