From Spread to a Hand Calculation
In Interpreting the IQR in Context, you described the width of the middle half of a distribution. Another measure of spread, the standard deviation, summarizes how far observations typically are from their mean. In Describing Spread in Context, you saw the sample standard deviation written as \(s\). Now you will calculate it by hand for a small sample.
The calculation has several linked steps: find the sample mean, subtract it from every observation, square each difference, add those squares, divide by \(n-1\), and take the square root. Keeping the steps in order—and showing them clearly—helps prevent sign, denominator, and rounding errors.
Here, \(x\) represents an individual observation, \(\bar{x}\) is the sample mean, and \(n\) is the number of observations. The difference \(x-\bar{x}\) is that observation’s deviation from the mean. A deviation can be negative, positive, or zero. Squaring it makes the result nonnegative, so deviations on opposite sides of the mean do not cancel when measuring spread.
The denominator is \(n-1\), not \(n\). For this sample calculation, use one less than the number of observations. The deviations from the sample mean always add to zero: the observations balance around their mean. Dividing the sum of squared deviations by \(n-1\) is the standard sample-standard-deviation formula. It also means the calculation is not simply the average of the squared deviations using \(n\).
Before beginning, find \(\bar{x}\) accurately. Every deviation depends on it, so an incorrect mean affects every row of the calculation. Keep the unrounded mean during the work whenever it is not a whole number. Round the final standard deviation only at the end, as appropriate for the context.
A Reliable Hand-Calculation Process
Add the observations and divide by \(n\).
For every observation, calculate \(x-\bar{x}\). Keep negative signs at this step.
Square every deviation separately, then add the squared deviations.
Calculate the sample variance, the sum of squared deviations divided by \(n-1\).
The result is \(s\), the sample standard deviation, in the original variable’s units.
The sample variance is an intermediate result, not the standard deviation itself. If observations are measured in minutes, squared deviations and the variance are in squared minutes. Taking the square root returns the standard deviation to minutes. This is one reason not to stop after dividing by \(n-1\).
A table makes the arithmetic easier to inspect. Include one row for each observation, even when values repeat. Check that the deviations add to zero (allowing for tiny rounding differences if the mean is decimal), and that each squared deviation is zero or positive.
Worked Examples: Calculating \(s\) by Hand
Worked Example: Daily Packages Sorted
A fictional sample of four workers sorted 4, 6, 8, and 10 packages during a short practice round. Calculate the sample standard deviation of the number of packages sorted.
Find the mean. There are \(n=4\) observations:
Calculate the deviations and their squares. Subtract 7 from each observation. Then square each result:
| \(x\) (packages) | \(x-\bar{x}\) (packages) | \((x-\bar{x})^2\) (packages squared) |
|---|---|---|
| 4 | \(4-7=-3\) | 9 |
| 6 | \(6-7=-1\) | 1 |
| 8 | \(8-7=1\) | 1 |
| 10 | \(10-7=3\) | 9 |
The deviations add to \(-3-1+1+3=0\), a useful check. The sum of squared deviations is \(9+1+1+9=20\). Since \(n-1=4-1=3\), divide by 3 and take the square root:
The sample standard deviation is about 2.582 packages. The calculation measures spread around the sample mean of 7 packages; the final unit is packages, not packages squared. The observations themselves are whole numbers, but a standard deviation need not be.
Worked Example: Daily Watering Times
A fictional gardener records the time spent watering a small set of plants on four days: 13, 15, 17, and 19 minutes. Find the sample standard deviation by hand.
Find the mean.
Find and square each deviation. The deviations are \(-3,-1,1,\) and \(3\) minutes. Their squares are \(9,1,1,\) and \(9\) minutes squared. Their sum is 20 minutes squared. Notice that these data have the same pattern of deviations as the package example, even though the observations and context differ.
Use the sample denominator and take the square root. There are four observations, so divide by \(4-1=3\):
The sample standard deviation of the recorded watering times is about 2.582 minutes. The variance before taking the square root is \(20/3\approx6.6667\) minutes squared. Reporting the variance as if it were the standard deviation would give the wrong measure and the wrong units.
As a check, the four deviations sum to zero, and the squared deviations total 20. The result agrees with the first example because both sets have the same distances from their respective means. Standard deviation depends on those distances, not on whether the observations are packages or minutes.
Worked Example: Growth of Four Seedlings
In a fictional observation, four seedlings grew 5, 7, 7, and 12 millimeters over the same interval. Calculate their sample standard deviation, showing how a repeated value is handled.
Find the sample mean.
Calculate each deviation and square it. Keep both observations of 7 in the table; each one contributes its own deviation and squared deviation.
| \(x\) (millimeters) | \(x-7.75\) (millimeters) | \((x-7.75)^2\) (millimeters squared) |
|---|---|---|
| 5 | \(-2.75\) | 7.5625 |
| 7 | \(-0.75\) | 0.5625 |
| 7 | \(-0.75\) | 0.5625 |
| 12 | 4.25 | 18.0625 |
The squared deviations sum to \(7.5625+0.5625+0.5625+18.0625=26.75\) millimeters squared. As a check, the signed deviations add to \(-2.75-0.75-0.75+4.25=0\).
Divide by \(n-1\) and take the square root. Here \(n-1=3\):
The sample standard deviation of the four seedlings’ growth amounts is approximately 2.986 millimeters. The repeated value of 7 appears twice because two seedlings had that measurement; omitting one would change the sample size, mean, and standard deviation.
Why the Details Matter
The sample mean is the reference point for every deviation. A deviation tells how far an observation is from that mean and in which direction. For example, \(x-\bar{x}=-3\) means the observation is 3 units below the mean; \(x-\bar{x}=3\) means it is 3 units above. Squaring removes the direction but preserves the size of the difference in squared form.
Because positive and negative deviations balance, simply adding them would not measure spread: their sum is zero. Squaring first prevents that cancellation. The sample variance then summarizes the squared distances using the \(n-1\) denominator, and the square root restores the units of the original measurements.
Standard deviation is expressed in the original units, but it is not the full range or the width of the middle half. As covered in Choosing IQR or Standard Deviation to Describe Spread, the measure to use depends on the distribution’s shape and unusual values. Here the goal is the arithmetic calculation for a sample, not deciding which spread summary is most suitable for every situation.
Common Mistakes and AP Exam Tips
- Dividing by \(n\). For the sample standard deviation \(s\), divide the sum of squared deviations by \(n-1\). For four observations, that denominator is 3, not 4.
- Forgetting to square a negative deviation correctly. The square of \(-3\) is \((-3)^2=9\), not \(-9\). Use parentheses or square the magnitude.
- Squaring the observations instead of the deviations. The formula uses \((x-\bar{x})^2\), not \(x^2\). Subtract the mean first, then square the result.
- Leaving out repeated observations. Each recorded value gets its own row, including repeats. A repeated measurement contributes more than once because it occurred more than once in the sample.
- Stopping at the variance. After dividing by \(n-1\), take the square root. The variance is in squared units; \(s\) is in the original units.
- Rounding too early. Keep exact values or several decimal places in the mean and squared deviations when needed. Round the final standard deviation, not every intermediate value.
- Giving a number with no unit or context. A response such as “\(s=2.986\)” is less clear than “The sample standard deviation of the seedlings’ growth amounts is about 2.986 millimeters.”
For a full-credit hand calculation, show the mean, the deviations or a clear table, the sum of squared deviations, the \(n-1\) denominator, and the square root. Include the variable’s units in the final result. A quick arithmetic check is to add the deviations and confirm they sum to zero, then check that no squared deviation is negative.
Check Your Understanding
Work each calculation in order. Keep track of the sample size and the units at every stage.
- For the sample values 3, 5, and 7, find \(\bar{x}\), list the deviations, and calculate \(s\).
- A sample contains 4, 4, 8, and 12 minutes. How many rows should a deviation table have, and what is the correct denominator when calculating \(s\)?
- In a hand calculation, the squared deviations total 18 for a sample of five observations. Write the expression for \(s\) and identify the units of the result if the data are measured in centimeters.
- A student calculates the deviations \(-2,0,2\), adds them to get zero, and reports that the standard deviation is zero. Explain the error and identify the next calculation step.
- If the variance for a sample of time measurements is \(9\) minutes squared, what is the sample standard deviation, including units?