D. Statistical Analysis · One-Variable Data AnalysisStandard Deviation from Frequency Tables, Grouped Data and Technology
D1.1About 70 minutes
Learning goals- I can calculate the mean and standard deviation of data in a frequency table.
- I can estimate the mean and standard deviation of grouped data using class midpoints.
- I can use a spreadsheet or calculator to find all the one-variable summary statistics, choosing the population or sample version.
- I can predict how adding a constant or multiplying by a constant changes the mean and standard deviation.
Words to know
computational formula
An equivalent formula for the variance that avoids computing each deviation: σ² = Σx² ÷ N − μ² (or, for a frequency table, Σf·x² ÷ N − μ²).
summary statistics
The numbers that describe a data set: n, mean, median, mode, minimum, maximum, quartiles, range, IQR, variance and standard deviation.
linear transformation
Changing every value by the same rule y = a + bx, such as converting °C to °F or adding bonus marks.
coefficient of variation (CV)
The standard deviation divided by the mean, usually as a percent. It compares spread relative to the size of the values.
Real data comes in tables
Statistics Canada, sports leagues and scientists rarely publish raw lists of thousands of values. They publish frequency tables and grouped tables. In the last lesson you calculated the standard deviation from a list. Now you will do it from tables, and you will let technology do the heavy lifting on big data sets, which is what the curriculum expects: "use technology to determine relevant numerical summaries".
Standard deviation from a frequency table
If the value x occurs f times, its squared deviation is counted f times:
σ² = Σf(x − μ)² ÷ N, where N = Σf
For a sample, divide by n − 1 instead. When the mean is not a nice number, the computational formula is faster and avoids rounding:
σ² = Σf·x² ÷ N − μ²
(You proved the list version, σ² = Σx² ÷ N − μ², in the last lesson's Challenge.)
Worked exampleExample 1: A discrete frequency table
Find the population standard deviation of the household sizes from lesson 1: x = 1, 2, 3, 4, 5, 6, 7 with f = 1, 4, 7, 10, 5, 2, 1 (N = 30, μ = 3.8).
- Make columns f·x and f·x². The f·x² column: 1·1 = 1, 4·4 = 16, 7·9 = 63, 10·16 = 160, 5·25 = 125, 2·36 = 72, 1·49 = 49.
- Σf·x² = 1 + 16 + 63 + 160 + 125 + 72 + 49 = 486. (Σf·x = 114, as in lesson 5, so μ = 114 ÷ 30 = 3.8.)
- σ² = 486 ÷ 30 − 3.8² = 16.2 − 14.44 = 1.76.
- σ = √1.76 ≈ 1.33 people.
σ ≈ 1.33 people. Check with the deviation method for one row: the 10 households of 4 contribute 10 × (4 − 3.8)² = 0.4 to Σf(x − μ)²; all seven rows together give 52.8, and 52.8 ÷ 30 = 1.76 ✓.
The shaded band runs from one standard deviation below the mean to one above. Here 22 of the 30 households (sizes 3, 4 and 5) fall inside it, about 73%.Grouped data: estimate with midpoints
With a grouped table, use the class midpoints m in place of x:
σ² ≈ Σf·m² ÷ N − μ², with μ ≈ Σf·m ÷ N
For a sample, use s² ≈ (Σf·m² − n·x̄²) ÷ (n − 1). As with the mean, the result is only an estimate, because it pretends every value sits at its class midpoint.
Worked exampleExample 2: Grouped data
Estimate the sample standard deviation of the 24 pumpkin masses using the grouped table: midpoints 4, 6, 8, 10, 12, 14 with frequencies 2, 5, 8, 5, 2, 2. (The estimated mean is 8.5 kg from lesson 5.)
- f·m²: 2·16 = 32, 5·36 = 180, 8·64 = 512, 5·100 = 500, 2·144 = 288, 2·196 = 392. Σf·m² = 1 904.
- Σf(m − x̄)² = Σf·m² − n·x̄² = 1 904 − 24(8.5²) = 1 904 − 1 734 = 170.
- s² ≈ 170 ÷ (24 − 1) ≈ 7.39, so s ≈ 2.72 kg.
- Compare with the raw data: a spreadsheet's STDEV.S on all 24 masses gives about 2.74 kg. Very close.
s ≈ 2.72 kg (estimated from the grouped table; the exact sample standard deviation is about 2.74 kg).
Let technology do it
Spreadsheet (data in A2:A501):
=COUNT(A2:A501), =AVERAGE(...), =MEDIAN(...), =MIN(...), =MAX(...)=QUARTILE.EXC(A2:A501, 1) and =QUARTILE.EXC(A2:A501, 3) (other quartile functions use slightly different rules; see lesson 8)=STDEV.S(...) (sample) or =STDEV.P(...) (population); =VAR.S(...) or =VAR.P(...)- For a frequency table with values in A and frequencies in B: mean =
=SUMPRODUCT(A2:A8,B2:B8)/SUM(B2:B8) and σ² = =SUMPRODUCT(B2:B8,A2:A8^2)/SUM(B2:B8) - mean^2 (in Google Sheets, wrap this formula in ARRAYFORMULA if needed).
Graphing calculator: enter the values in L1 (and frequencies in L2), then 1-Var Stats L1 (or L1, L2). It reports x̄, Σx, Σx², Sx, σx, n, minX, Q1, Med, Q3 and maxX.
Whichever tool you use, report the statistics with sensible rounding (usually one more decimal place than the data) and say whether s or σ was used.
What happens when every value changes the same way?
Suppose every value is changed by the rule y = a + bx.
- Adding a constant a shifts every value, and the mean, median and quartiles, by a. The spread does not change: σ, IQR and range stay the same.
- Multiplying by a constant b multiplies the mean and median by b, and multiplies σ, the IQR and the range by |b|. The variance is multiplied by b².
So for y = a + bx: mean_y = a + b·mean_x and σ_y = |b|·σ_x.
Adding 5 slides every dot 5 units right: the mean rises by 5 and σ stays 2. Multiplying by 2 doubles every distance: the mean doubles and σ doubles to 4.Worked exampleExample 3: Converting units
Suppose that during one January week, daily low temperatures in Sudbury had mean −18°C and standard deviation 5°C. Find the mean and standard deviation in °F, using F = 1.8C + 32.
- This is y = a + bx with a = 32 and b = 1.8.
- Mean: 1.8(−18) + 32 = −32.4 + 32 = −0.4°F.
- Standard deviation: |1.8| × 5 = 9°F. The +32 does not affect spread.
Mean −0.4°F, standard deviation 9°F.
Comparing spread on different scales: the coefficient of variation
Is a standard deviation of 9 kg large? For newborn babies, yes; for adult moose, no. The coefficient of variation CV = σ ÷ μ × 100% compares spread relative to the mean. Use it only for positive data measured from a true zero (masses, times, prices), not for temperatures in °C. Example with illustrative numbers: newborns, mean 3.4 kg, σ 0.5 kg → CV ≈ 15%; a set of bags of flour, mean 1 002 g, σ 4 g → CV ≈ 0.4%.
Just for funA statistician can stand with one foot in a hot tub and the other in a snowbank and say that, on average, she feels fine. That is why we always report the standard deviation too.
Hands-on activitySpreadsheet investigation: build your own statistics report
You need: a computer or tablet with a free spreadsheet (Google Sheets or similar), and a data set. Use the reaction-time data from lesson 6, or download a one-variable data set (for example, from the Statistics Canada Census at School page, or a sports league's public player statistics).
- Paste at least 30 values into column A.
- In column C, write labels (n, mean, median, min, Q1, Q3, max, range, IQR, s, σ), and in column D the matching formula for each.
- Then change one value to something extreme (for example, multiply the largest value by 10). Record which statistics change a lot and which barely change.
- Undo the change. Now add 10 to every value (in column B,
=A2+10, filled down) and repeat the statistics on column B. Then try =PRODUCT(A2,3) (which multiplies each value by 3).
What to look for: in step 3 the mean, range and standard deviation jump while the median and IQR barely move (they are resistant). In step 4, adding 10 raises the centre statistics by exactly 10 and leaves s, range and IQR unchanged; multiplying by 3 triples both the centre and the spread statistics.
Your turn
1Find μ and σ for the frequency table x = 0, 1, 2, 3 with f = 4, 8, 6, 2.
N = 20. Σf·x = 0 + 8 + 12 + 6 = 26, μ = 1.3. Σf·x² = 0 + 8 + 24 + 18 = 50. σ² = 50 ÷ 20 − 1.3² = 2.5 − 1.69 = 0.81, σ = 0.9.
2If the table in the previous question were a sample, what is s?
Σf(x − x̄)² = 50 − 20(1.69) = 16.2. s² = 16.2 ÷ 19 ≈ 0.853, s ≈ 0.92.
3Estimate the mean and population standard deviation: classes [0, 10), [10, 20), [20, 30) with f = 5, 10, 5.
Midpoints 5, 15, 25. μ = (25 + 150 + 125) ÷ 20 = 15. Σf·m² = 125 + 2 250 + 3 125 = 5 500. σ² = 5 500 ÷ 20 − 225 = 50, σ ≈ 7.07.
4A data set has mean 40 and σ = 6. Every value is increased by 8. Give the new mean and σ.
Mean 48, σ 6 (adding a constant does not change spread).
5A data set has mean 40 and σ = 6. Every value is multiplied by 0.5. Give the new mean, σ and variance.
Mean 20, σ 3, variance 3² = 9 (the old variance 36 times 0.5² = 0.25).
6On a calculator, 1-Var Stats shows Sx = 4.21 and σx = 4.08. Your data is a random sample of 15 students from a school of 900. Which do you report?
Sx = 4.21, the sample standard deviation, because the data is a sample used to describe the school.
More practice: warm-up
1Which spreadsheet function gives the population standard deviation?
2In a frequency table, what is N?
The sum of the frequencies, Σf.
3Adding 3 to every value changes σ by how much?
4Multiplying every value by 4 changes σ how?
5What value is used for x when estimating from grouped data?
More practice: on your own
1A frequency table: x = 10, 20, 30 with f = 3, 4, 3. Find μ and σ.
N = 10, Σf·x = 30 + 80 + 90 = 200, μ = 20. Squared deviations: 3(100) + 4(0) + 3(100) = 600. σ² = 60, σ ≈ 7.75.
2A teacher's test marks have mean 64 and σ = 12. She rescales with y = 1.1x + 5. Find the new mean and σ.
Mean = 1.1(64) + 5 = 75.4. σ = 1.1 × 12 = 13.2.
3The 1-Var Stats output for a sample gives n = 12, Σx = 96, Σx² = 840. Find x̄ and s.
x̄ = 96 ÷ 12 = 8. Σ(x − x̄)² = Σx² − n·x̄² = 840 − 12(64) = 72. s² = 72 ÷ 11 ≈ 6.545, s ≈ 2.56.
4Explain why the standard deviation estimated from a grouped table may differ from the true standard deviation.
The estimate assumes every value is at its class midpoint. Real values are spread through each class, so the true squared deviations differ; with narrow classes and many values the estimate is usually close.
5Compare the relative spread: Product A has mean $40 and σ = $6; Product B has mean $250 and σ = $20.
CV_A = 6 ÷ 40 = 15%; CV_B = 20 ÷ 250 = 8%. Product B has a larger σ in dollars, but Product A varies more relative to its price.
Challenge
1A data set has mean 50 and σ = 10. Find constants a and b (with b > 0) so that y = a + bx has mean 0 and σ = 1. (You will meet this transformation again in lesson 10.)
σ_y = b·10 = 1, so b = 0.1. Mean: a + 0.1(50) = 0, so a = −5. y = −5 + 0.1x = (x − 50) ÷ 10.
2A class of 20 students has mean 70 and σ = 8; another class of 30 students has mean 75 and σ = 6. Find the mean and population σ of all 50 students combined.
Combined mean = (20·70 + 30·75) ÷ 50 = (1 400 + 2 250) ÷ 50 = 73. Use Σx² = N(σ² + μ²) for each class: class 1: 20(64 + 4 900) = 99 280; class 2: 30(36 + 5 625) = 169 830. Total Σx² = 269 110. σ² = 269 110 ÷ 50 − 73² = 5 382.2 − 5 329 = 53.2, σ ≈ 7.29.
3Explain why the combined σ in the previous question (about 7.29) is larger than the average of 8 and 6 weighted by class size, (20·8 + 30·6) ÷ 50 = 6.8.
The combined spread includes the spread within each class plus the spread between the classes, since the class means (70 and 75) are different. That between-class difference adds extra variation.
Check your understandingQuiz
1. For a frequency table, the population variance can be computed as
2. Every value in a data set is multiplied by 3 and then 7 is added. The original σ was 2. What is the new σ?
3. A grouped table's mean and standard deviation calculated with midpoints are
4. On a graphing calculator, which value is the sample standard deviation?
5. Temperatures have mean 20°C and σ = 4°C. In °F (F = 1.8C + 32) the standard deviation is
6. A sample has n = 5, Σx = 30 and Σx² = 200. What is s²?
For parents and teachersBig idea (D1.1): the same standard deviation idea works for lists, frequency tables (weight each squared deviation by f) and grouped tables (use midpoints, and get an estimate). Technology should do the arithmetic for real data sets, but your teen must still choose sample or population versions and interpret the results.
How to help: Sit with your teen while they build the spreadsheet report in the activity. Ask them to predict, before pressing Enter, whether a change will move the mean, the median, or the standard deviation.
Common difficulties:
- Multiplying the frequency by the squared deviation of the wrong row (keep the columns lined up).
- Forgetting to subtract μ² in the computational formula.
- Thinking that adding a constant changes the standard deviation.
- Choosing σx when the data is a sample.