Frequency Distribution
calculator.
A frequency table sorts raw data into counts, so you can see its shape at a glance.
- Grouped mean
- 81.25
- Grouped median
- 81.667
- Grouped SD (sample)
- 8.717
Treating each value as its class midpoint puts the mean at 81.25, 0.25 above the exact 81. A Pearson skew of −0.17 means the mean sits below the median, which points to a longer tail on the left.
Set your classes
The same data under each rule
| Rule | Classes | Width | Mean | Off by | Empty |
|---|---|---|---|---|---|
| SturgesMean 81.25 | 6 | 5 | 81.25 | +0.25 | 0 |
| Square rootMean 81.2 | 5 | 6 | 81.2 | +0.2 | 0 |
| RiceMean 81.25 | 6 | 5 | 81.25 | +0.25 | 0 |
The shape of the data
The tallest bars are 75 to under 80, 85 to under 90, 90 to 95. The grouped mean is 81.25 and the grouped median 81.667.
Read the table backward
Drag the point along the curveAbout 50% of the values sit below 81.667, reading a straight line through each class.
- About 50% of values sit below
- 81.667
Frequency table
| Class | Mid | Freq. | Rel. | Cum. | Cum. % |
|---|---|---|---|---|---|
| 65 to under 70Midpoint 67.5 | 67.5 | 3 | 15% | 3 | 15%3 values |
| 70 to under 75Midpoint 72.5 | 72.5 | 2 | 10% | 5 | 25%5 values |
| 75 to under 80 (modal)Midpoint 77.5 | 77.5 | 4 | 20% | 9 | 45%9 values |
| 80 to under 85Midpoint 82.5 | 82.5 | 3 | 15% | 12 | 60%12 values |
| 85 to under 90 (modal)Midpoint 87.5 | 87.5 | 4 | 20% | 16 | 80%16 values |
| 90 to 95 (modal)Midpoint 92.5 | 92.5 | 4 | 20% | 20 | 100%20 values |
Copy result gives this table as tab-separated text that pastes into a spreadsheet.
Working
- 1Find the range95 − 65 = 30
- 2Pick the class count with Sturges' rulelog₂(20) + 1 = 5.322, rounded up to 6
- 3Divide the span by the classes, rounding up306= 5, so width 5
- 4Count each class, lower limit in and upper limit out3, 2, 4, 3, 4, 4
- 5Grouped mean: midpoints times frequencies over n1,62520= 81.25
- 6Grouped median: inside the class from 8080 +10 − 93× 5 = 81.667
- 7Check: the frequencies add back to n3 + 2 + 4 + 3 + 4 + 4 = 20
How it's worked out
OpenStax defines a frequency as the number of times a value occurs, and a relative frequency as that count over the total. Cumulative columns add each row to the ones before it, so the last row is always the whole data set.
For measurements with many different values, you sort them into equal classes first. If you leave the boxes blank, the tool picks the count with Sturges' rule, where n is the number of values. Rounding up matches the form used in teaching materials.
Then it divides the span of the data by k and rounds the width up to two significant figures, so that k classes reach the largest value.
Each class holds its lower limit and leaves out its upper limit, except the last, which also holds the largest value. So every value counts once. The square-root rule and the Rice rule sit beside Sturges for comparison, and no rule is right for all data.
| Values | Sturges | Square root | Rice |
|---|---|---|---|
| 20 | 6 | 5 | 6 |
| 50 | 7 | 8 | 8 |
| 100 | 8 | 10 | 10 |
| 500 | 10 | 23 | 16 |
| 1,000 | 11 | 32 | 20 |
| 5,000 | 14 | 71 | 35 |
The grouped mean stands every value on its class midpoint m, weights it by the frequency f and divides by the total.
The grouped median finds the class that holds the middle value, then reads how far in it sits. L is that class’s lower limit, B the count below it, G its frequency and w its width.
Worked examples
Twenty test scores from 65 to 95
The range is 30. With 20 scores, Sturges gives 5.32, which rounds up to 6 classes, and the range over 6 is a width of 5. The classes run from 65 to 95, and they hold 3, 2, 4, 3, 4, 4 scores.
Midpoints times frequencies add to 1,625, so the grouped mean is 81.25. The exact mean of the raw scores is 81, so grouping cost 0.25 of a mark.
The median is the 10th of 20 values. 9 scores sit below 80 and that class holds 3, so the grouped median is 81.667.
Grouping twenty heights by round numbers
Left alone, the rule gives classes of 3.7 cm from 153 cm, which is hard to read out. Set a width of 5 and a start of 150, and you get 5 classes on round limits, holding 1, 4, 5, 5, 5 people.
The grouped mean shifts a little, to 164.75 cm, against an exact 164.5 cm. The classes from 160 to 175 cm tie as the tallest, with 5 people each. The start of the first class can change the look of a histogram, so try one or two before you settle on one.
Twenty letter grades
Categories need no classes, only a tally: A 8, B 6, C 4, D 2. A is the mode, with 40% of the grades.
By the second row the cumulative column reaches 70%, so that share of the class has a B or better. This reading only works because the rows have a natural order, and it would mean nothing for favorite colors.
Reading your result
Relative frequency lets you compare groups of different sizes. The column adds to 100%, so a class of 30 and a class of 300 can sit side by side. NIST also notes that dividing by the count and the class width gives a histogram whose total area is 1.
Cumulative frequency answers "how many are below this?" Plotted, it gives a curve from which you can read quartiles and percentiles. The reading assumes the values spread evenly through each class, so treat it as an estimate.
A histogram shows five things. NIST lists center, spread, skewness, outliers and more than one peak. Two separate peaks can mean two groups got mixed together.
Skew shows up in the mean and median. A long tail to the right pulls the mean above the median. NIST’s Pearson 2 coefficient puts a number on that: 3 times the gap between them, over the standard deviation. A positive value points to a longer right tail.
Common mistakes
- Letting a boundary value land twice. The value on a limit belongs to one class. With limits of 0, 10, 20, 30 and 40, the classes here hold 1, 1, 1, 2 of the values 0, 10, 20, 30 and 40, with 40 in the last class.
- Quoting the grouped mean when you have the raw data. It is an estimate. Use the exact figure if you can, and keep the grouped formula for tables that have no raw data behind them.
- Too few or too many classes. Too few hide the shape, and too many leave a ragged chart with gaps. Lane’s advice is to try several widths and keep what best shows the data.
- Mixing cases in text. Text is compared exactly, so Yes and yes make two rows. Numbers are different: 2 and 2.0 count as one value.
- Using classes of unequal width with this tool. It only builds equal classes, so a table from a report with open-ended or uneven classes will not match.
Questions people ask
Sources
- OpenStax, Introductory Statistics 2e, section 1.3: Frequency, frequency tables, and levels of measurement
- OpenStax, Introductory Statistics 2e, section 2.5: Measures of the center of the data
- Lane, Online Statistics Education, Histograms
- KUB Datalab (University of Copenhagen Library), R toolbox: Histograms
- NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.3.14: Histogram
- NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5.11: Measures of skewness and kurtosis
- Math Is Fun, Mean, median and mode from grouped frequencies