信任度间计算器
构建一个从样本平均值、自毁和大小中平均值的置信间隔。
输入结果时更新 。
关于此计算器
A confidence interval gives a range that is likely to contain the true population mean, estimated from a sample. Instead of a single best guess it reports a band together with a confidence level that says how often such bands capture the true value.
This calculator uses the z-interval: mean ± z*·(σ / √n), where z* is the standard-normal critical value for your chosen confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%) and σ / √n is the standard error. It reports the bounds, the margin of error and the standard error, and a table shows the interval at the 90%, 95% and 99% levels so you can see how the range widens as you demand more confidence.
Worked example: a sample mean of 100 with a standard deviation of 15 and 50 observations has a standard error of 15 ÷ √50 ≈ 2.12. At 95% confidence the margin is 1.96 × 2.12 ≈ 4.16, giving an interval of about 95.84 to 104.16. The z-interval suits large samples (roughly n ≥ 30) or a known population standard deviation; for small samples use a t-interval instead.
经常问到的问题
95%的置信间隔是什么意思?
这意味着如果你多次重复取样并每次建立间隔, 大约95%的间隔将包含真实的人口平均值。 并不意味着这个特定的间隔值中平均值为95%。
什么时候我应该用T - interval代替?
当样本小(大约30岁以下)且人口标准偏差未知时使用 t interval。 t 分布的尾巴较重,比这个 z 的间隔稍宽,更谨慎。
置信间隔的误差范围是多少?
The margin of error is the half-width of the interval, z*·(σ / √n). You add and subtract it from the sample mean to get the upper and lower bounds, so a smaller margin means a more precise estimate.
我如何使信心的间隔缩小?
收集更大的样本, 因为宽度会随正方根 n 缩小, 或者接受较低的置信度。 降低数据中的可变性也会缩短间隔。 将样本大小增加四倍, 大约将宽度减半 。
更高的信任度是否使间隔扩大?
是的。 要求更大的信任需要更大的关键值 z*, 所以99%的间隔比从同一数据中构建的95%的间隔要大。 信任和精确之间总是有权衡的。
标准错误是什么?
标准误差是标准差除以样本大小的平方根( 12 / n) 。 它衡量样本本身的平均值会因抽样而异, 并且是误差的构件。
API - 使用代码中的计算器
将此计算器称为自由 JSON 端点 。 不需要按键 。 将字段值发送到下面作为查询参数或 JSON 。 读取 API 全部文件 →
终点
GET https://calculator.free/api/v1/confidence-interval/
curl
curl "https://calculator.free/api/v1/confidence-interval/?mean=100&sd=15&n=50&conf=1.96"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/confidence-interval/?" + new URLSearchParams({
"mean": "100",
"sd": "15",
"n": "50",
"conf": "1.96"
}));
const data = await r.json();
console.log(data.results);
成果仅是一般指导的估计数,而不是财务、医疗或税务咨询。