Skip to the workspace
Pebellslearn by building
Statistical Inference  ›  Lesson

Samples and Standard Error

Statistics 14 minA statistic computed from a sample varies from sample to sample, and the standard error measures that variation, shrinking with the square root of the sample size.

ai data scientist / Samples and Standard Error

Explore each scene at your own pace.

01 · The rule

The rule

Samples and Standard Error

Pantry has 50,000 customers. It surveys 400 of them, chosen at random, and the average delivery rating comes back as 4.1 out of 5. Nobody asked the other 49,600. How far from 4.1 could the true average be? If you cannot answer that, you cannot say whether next month's 4.0 is a real drop or just a different 400 people.

The rule

Every estimate wobbles; the standard error says by how much.

The population is everyone you care about: all 50,000 customers. The sample is the 400 you measured. Draw a different random 400 and the average would come out a little different, perhaps 4.07 or 4.13. The standard error (SE) is the typical size of that sample-to-sample wobble.

For an average, divide the spread of individual values by the square root of the sample size:

SEmean=snSE_{\text{mean}} = \frac{s}{\sqrt{n}}

Ratings have a standard deviation s=0.8s = 0.8, and 400=20\sqrt{400} = 20, so SE=0.8/20=0.04SE = 0.8 / 20 = 0.04. The survey average is typically within a few hundredths of the truth.

For a proportion, such as the share of users who convert, the spread comes from the proportion itself:

SEprop=p(1−p)nSE_{\text{prop}} = \sqrt{\frac{p(1-p)}{n}}

Keep two ideas apart. The standard deviation describes how much individual customers differ, and it does not shrink as you ask more people. The standard error describes how much your average would move between samples, and it does shrink.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.