Statistics: averages, errors, tests
The mean, the median and the spread, the standard error, a confidence interval and the sample size a poll needs, and at the top level the traps of hypothesis testing.
How to solve it
Statistics answers what a sample says about a large population, and how far to trust it. The mean and the median describe the centre, the standard deviation the spread, and the standard error the precision of the mean: it shrinks like the square root of the sample size.
Step by step
- The mean is the sum over $n$. The median is the middle of the sorted list (for even $n$, the average of the two middle numbers).
- The sample standard deviation: add the squared deviations from the mean, divide by $n - 1$, take the root.
- The standard error of the mean is $\frac{s}{\sqrt n}$; a 95% interval is the mean $\pm 1.96$ standard errors.
- The sample size for a proportion near $50\%$: the margin is $E = 1.96\sqrt{\frac{0.25}{n}}$, so $n = \frac{1.96^2 \cdot 0.25}{E^2}$, rounded up.
- With several tests the chance of at least one false alarm is $1 - (1 - \alpha)^k$.
Common mistakes
- Dividing by $n$ instead of $n - 1$ in the sample deviation.
- Confusing the standard deviation (the spread of the data) with the standard error (the precision of the mean).
- Finding a median without sorting the numbers.
- Thinking a false alarm is nearly impossible in five tests at the $0.05$ level: $1 - 0.95^5 \approx 0.23$.