Variance and standard deviation
Standard deviation, or SD, describes how much values spread around the mean. Variance is the step before taking the square root.
Let n be the number of observed values, and x-bar their mean. A deviation is x_i minus x-bar. Squaring makes negative and positive deviations contribute positively.
Sample variance: sum of squared deviations divided by n-1. Sample SD: square root of sample variance. Population-style variance: divide by n when describing the entire listed population or following a specified scaling convention.
The n-1 correction accounts for estimating the mean from the same sample. Under the usual independent random-sample assumptions it makes sample variance unbiased for population variance. It does not guarantee every sample estimate is too small before correction, and sample SD itself is not exactly unbiased.
Variance has squared units, such as points squared. SD returns to points. SD describes dispersion of observations; it is not the standard error of a mean and not a typical prediction error.
Pandas Series.std() defaults to ddof=1; NumPy's ordinary array SD defaults to ddof=0. With missing values, also choose matching missing-value handling before comparing implementations. One observed value is insufficient for sample SD; a constant group has SD zero.
Sources: W2 PDF pp. 2-60; L2 Sections 1-8. The personalised Lab 2 has 240 synthetic students, unlike the 1,200-student lecture dataset. Do not mix their numbers.
The mean and SD formulas in the lecture are applied to your eight generated scores. The code checks your working after you try it.
The lecture separates recovered observations from assumed replacements. The mean-fill demonstration and sensitivity table show different consequences of assumptions.
Practice problems
Supplementary study questions on the lecture concepts — not verbatim exam questions. Each answer counts toward spaced review.
1. Conceptual understanding
Definitions and distinctions.
If scores are in points, what are the units of sample variance?
Which divisor is used by sample variance for n observations?
2. Application
Apply the concept to a case or calculation.
For [2,4,6], which deviations from the mean are correct?
For deviations −2,0,2, what is the sum of squares?
3. Interpretation and limitations
Evaluate assumptions and justify conclusions.
What is the sample SD for [2,4,6]?
All five observed values are 10. What is their SD?
Explain it in writing
Self-checked, not marked. Write a few sentences, then compare with the example answer. Your writing is saved as you type.
Show an example answer
Deviations are measured in the original unit. Squaring them produces squared units. Taking the square root returns SD to the original unit.
Check: did you answer the question, use evidence or working, and avoid claiming more than the evidence supports?
Show an example answer
Not with the usual n−1 formula: the divisor is zero. You need at least two observations for that sample-SD calculation.
Check: did you answer the question, use evidence or working, and avoid claiming more than the evidence supports?