how-to · 5 min read
Standard deviation and linear regression: reading the numbers correctly
Standard deviation turns a list of measurements into one number for spread, and a regression line turns paired data into one number for slope, yet both are easy to quote without understanding. The population and sample versions of the standard deviation differ by a denominator, and a high correlation says nothing on its own about cause.
This guide works through the arithmetic and the interpretation: what mean, variance and standard deviation measure, when to divide by n or n − 1, what r and r² describe and do not describe, how least squares chooses a line, and how to report uncertainty and predictions without overclaiming.
Centre and spread: mean, variance and standard deviation
The mean is the balance point of a data set: add the values and divide by how many there are. Spread is measured from that centre. Each value's deviation from the mean is squared, the squares are averaged to give the variance, and the square root of the variance is the standard deviation. Squaring stops positive and negative deviations from cancelling and penalises large gaps more than small ones.
For the list 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the squared deviations are 9, 1, 1, 1, 0, 0, 4 and 16, which sum to 32. Dividing by 8 gives a population variance of 4 and a standard deviation of 2; dividing by 8 − 1 gives a sample variance of about 4.57 and a sample standard deviation of about 2.14. The median and interquartile range describe the same data without using every value, which makes them more resistant to outliers.
Population or sample: the n − 1 question
When the data is the entire population you care about, divide the squared deviations by n; this gives the population variance and standard deviation, written σ² and σ. When the data is a sample used to estimate a larger population, divide by n − 1 instead, giving s² and s. The correction exists because deviations are measured from the sample mean rather than the unknown population mean, which makes them slightly too small; dividing by a smaller number compensates.
For the same data, s is always a little larger than σ, and the gap shrinks as n grows. A lab report or assignment normally reports the sample standard deviation unless the whole population is genuinely present, and it should say which version it used. With a single value the population standard deviation is 0 and the sample version is undefined, because n − 1 is zero.
Fitting a line: slope, intercept, r and r²
A least-squares line is the straight line that minimises the sum of squared vertical distances from the data points to the line. Its slope is the predicted change in y for a one-unit increase in x, and its intercept is the predicted y when x is zero, which may be meaningless if x never reaches zero. The fitted equation is usually written y = mx + b.
The correlation coefficient r runs from −1 to 1 and describes the direction and strength of the linear association: near 1 as x rises, y rises; near −1 as x rises, y falls; near 0 there is little linear pattern. Squaring it gives r², the share of the variation in y explained by the fitted line. Neither number proves the model is right: a curved relationship, an outlier or a narrow range of x can all produce misleading coefficients, which is why the residuals deserve a look.
Correlation is not causation, and extrapolation is not prediction
A correlation can appear because one variable causes the other, because both follow a third factor, because the sample is small, or by coincidence. Ice-cream sales and sunburn rise together, but neither causes the other; the weather drives both. Establishing causation needs a controlled design, a plausible mechanism and replication, not just a coefficient.
Predicting beyond the range of the observed x values is extrapolation: it assumes the straight-line relationship continues unchanged, which the data cannot confirm. Even inside the range, a line gives a point estimate, not a guarantee. If the residuals curve, fan out or contain a single dominant outlier, a straight line may be the wrong model, and a prediction should be reported with its range and its assumptions.
Reporting the numbers honestly
A good report states how many observations there are, which standard deviation was used, and the units of every quantity. It rounds at the end to the precision the measurement supports, giving the slope units of y per unit of x and keeping the intercept only when x = 0 is meaningful. For a regression it also quotes the range of x used, because r and the slope describe that range and not any other.
Uncertainty is more than the standard deviation: the standard deviation describes the spread of observations, while the standard error of the mean is s divided by the square root of n, and a regression slope has its own standard error. A browser calculator can show the fit and the arithmetic, but a full uncertainty budget, prediction intervals and model checking are analysis decisions that belong with the data and the procedure.
- Report n, the unit of every quantity and whether the standard deviation is the sample or population version.
- Round the final values to the significant figures the measurement supports.
- Quote r or r² together with the range of x, not as a stand-alone score.
- Check the residuals for curvature, outliers or changing spread before trusting a line.
- Treat predictions outside the observed range as extrapolations, and say so.