Σ
SDCalc
中級Fundamentals·9 min

標準偏差の公式を完全理解しよう!母集団と標本の違いからステップバイステップの計算手順、Pythonでの実装方法まで徹底解説

標準偏差の公式をステップバイステップで徹底的にマスターしましょう。母集団と標本の公式の違い、n-1で割る理由、具体的な計算手順、そしてPythonを使った実装方法までわかりやすく解説します。データのばらつきを正確に把握し、統計的な洞察を深めるための必須知識が身につく実践ガイドです。

By Standard Deviation Calculator Team · Data Science Team·Published

標準偏差の公式とは?

標準偏差の公式は、データ値の集合におけるばらつき(変動や散らばり)の度合いを定量化するための数学的な方程式です。標準偏差が小さい(低い)場合は、データポイントが平均(μまたはx̄)の近くに集まっていることを示し、標準偏差が大きい(高い)場合は、データポイントがより広い範囲に散らばっていることを示します。

統計学では、対象が母集団全体なのか、そこから抽出された標本なのかによって、使用する公式が異なります。その核心的な概念は、平均からの偏差の二乗の平均を計算すること(これは分散 (σ²) として知られています)、そして元の単位に戻すために平方根をとることです。

母集団の標準偏差

σ = √[ Σ (xi - μ)² / N ]
  • σ(シグマ):母集団の標準偏差
  • Σ(シグマ):総和
  • xi:データセット内の各値
  • μ(ミュー):母集団の平均
  • N:母集団のデータ数(総数)

母集団と標本の標準偏差の違い

実世界のデータ分析において、母集団全体のデータを入手できることは稀です。多くの場合、より大きな母集団について推測するために標本を収集します。標本は母平均を推定するに過ぎないため、標本に対して母集団の公式を用いて標準偏差を計算すると、真のばらつきを常に過小評価してしまいます。この偏り(バイアス)を補正するために、標本の標準偏差の公式を使用します。

標本の標準偏差

s = √[ Σ (xi - x̄)² / (n - 1) ]

公式を使い間違えないように注意!

標本に「N」を使用したり、母集団に「n-1」を使用したりすると、ばらつきの測定値が正しくなくなります。n-1を用いる標本の公式はベッセルの補正として知られており、母分散の不偏推定を行う上で必須となります。

公式のステップバイステップ計算手順

手計算で標準偏差を求めるには、体系的なアプローチが必要です。以下の手順に従うことで、任意のデータセットについて母集団または標本の標準偏差を正確に計算することができます。

1

平均を計算する

すべてのデータポイントの合計(Σxi)をデータの総数(Nまたはn)で割り、平均(μまたはx̄)を求めます。
2

偏差を求める

各データポイントから平均を引いて偏差を求めます:(xi - 平均)。
3

偏差を二乗する

前のステップで計算した各偏差を二乗します:(xi - 平均)²。これにより、すべての値が正の数になります。
4

偏差平方和を求める

すべての二乗偏差を合計して、偏差平方和を求めます:Σ(xi - 平均)²。
5

Nまたはn-1で割る

母集団の場合はNで割ります。標本の場合は(n - 1)で割ります。これにより分散(σ²またはs²)が得られます。
6

平方根をとる

分散の平方根をとって、標準偏差(σまたはs)を求めます。

なぜ標本の公式はn-1で割るのか?

nの代わりにn-1で割る概念は、ベッセルの補正として知られています。標本平均(x̄)は標本データ自体から計算されるため、偏差(xi - x̄)は数学的に合計がゼロになるという制約があります。つまり、データポイントは真の母平均(μ)よりも標本平均にわずかに近くなってしまうのです。

n-1自由度)で割ることで、この過小評価を補正するのにちょうど良い大きさに分散を膨らませ、母分散の不偏推定量を提供することができます。

Further Reading

Sources

References and further authoritative reading used in preparing this article.

  1. NIST/SEMATECH 統計的方法e-ハンドブック
  2. 標準偏差 - Wikipedia
  3. ベッセルの補正

How to Read This Article

A statistics tutorial is a practical interpretation guide, not just a formula dump. It refers to the assumptions, notation, and reporting language that analysts need when they explain a result to a teacher, manager, client, or reviewer. The article body covers the specific topic, while the sections below create a common interpretation frame that readers can reuse across related metrics.

Reading goalWhat to focus onCommon mistake
DefinitionWhat the metric is and what quantity it summarizesTreating the formula as self-explanatory
Formula choiceSample versus population assumptions and notationUsing n when n-1 is required or vice versa
InterpretationWhether the result indicates concentration, spread, or riskCalling a large value good or bad without context

Frequently Asked Questions

How should I interpret a high standard deviation?

A high standard deviation means the observations are spread farther from the mean on average. Whether that spread is acceptable depends on the context: wide dispersion might signal risk in finance, instability in manufacturing, or genuine natural variation in scientific data.

Why do some articles mention n while others mention n-1?

The denominator reflects the difference between population and sample formulas. Population variance and population standard deviation use N because the full dataset is known. Sample variance and sample standard deviation often use n-1 because Bessel’s correction reduces bias when estimating population spread from a sample.

What is a statistical interpretation guide?

A statistical interpretation guide is a page that moves beyond arithmetic and explains meaning. It tells you what a metric is, when the formula applies, and how to describe the result in plain English without overstating certainty.

Can I cite this article in a report?

You should cite the underlying authoritative reference for formal work whenever possible. This page is best used as an explanatory bridge that helps you understand the concept before quoting the original standard or handbook.

Why include direct citations on every article page?

Direct citations give readers a route to verify the definition, notation, and assumptions. That improves trust and reduces the chance that a simplified explanation is mistaken for the entire technical standard.

Authoritative References

These sources define the concepts referenced most often across our articles. Bessel's correction is a sample adjustment, variance is a squared measure of spread, and standard deviation is the square root of variance expressed in the same units as the data.