Tutorials › Introduction to Statistics › Weighted Means from Frequency Tables

Center, Spread and Position · Tutorial 148 of 996

Weighted Means from Frequency Tables

Use frequencies to account for repeated observations efficiently and calculate the same mean you would obtain from the full data list.

Beginner 9 min read

What You'll Learn

  • Identify the values and frequencies in a frequency table
  • Find the total number of observations by adding frequencies
  • Calculate a mean using the sum of value-times-frequency products
  • Explain why the frequency-table calculation matches the raw-data mean
  • Check a result for arithmetic and interpretation errors

Why Use a Frequency Table?

A data set may contain many repeated values. Writing every observation out is often unnecessary: a frequency table records each value once and states how many times it occurs. For example, instead of listing the same quiz score ten times, a table can show that the score occurred ten times. The table is more compact, but it still contains enough information to calculate the arithmetic mean, provided it records the observed values and their counts.

The essential idea is that a value occurring many times must contribute to the mean many times. A value occurring once contributes once; a value occurring five times contributes five times. Therefore, multiply each value by its frequency, add those products, and divide by the total number of observations. This is the same arithmetic used to calculate the mean from raw data, organized to take advantage of repeated values.

Definition: In a frequency table for exact observed values, each listed value \(x_i\) is paired with its frequency \(f_i\), the number of observations equal to that value. The total number of observations is \(n=\sum_{i=1}^{k} f_i\). The mean is $$ \bar{x}=\frac{\sum_{i=1}^{k} f_i x_i}{\sum_{i=1}^{k} f_i} =\frac{\sum_{i=1}^{k} f_i x_i}{n}, $$ where \(k\) is the number of distinct values listed.

A frequency is a count, so it is a nonnegative whole number. A value with frequency zero contributes no observations and can be omitted. The frequencies must account for every observation in the data set; if one observation is missing from the table or counted twice, the calculated mean will not describe the intended data. The formula here applies when the table lists exact observed values, not ranges that group together different values.

How to Calculate the Mean

A reliable calculation has three parts. First, multiply each value by its frequency to find that value's total contribution. Second, add the frequencies to find the number of observations. Third, divide the sum of the products by that total count. Keeping the product and frequency columns separate helps prevent a common error: dividing by the number of rows rather than by the number of observations.

1
Multiply each value by its frequency.
For every row, calculate \(f_i x_i\), the contribution of all observations recorded at \(x_i\).
2
Add the frequencies and products.
The frequency total is \(n\); the product total is \(\sum f_i x_i\).
3
Divide and interpret.
Calculate \(\bar{x}=(\sum f_i x_i)/n\), then state the result in the units of the data.

Worked Example: Commute Times

Suppose a hypothetical group of six students reports its one-way commute time in minutes. The frequency table is:

Commute time \(x_i\) (minutes)Frequency \(f_i\)Product \(f_i x_i\) (minutes)
10220
15345
20120
Total685

The table says that two commutes took 10 minutes, three took 15 minutes, and one took 20 minutes. The total count is \(n=2+3+1=6\). The sum of the value-frequency products is \(2(10)+3(15)+1(20)=20+45+20=85\) minutes.

Therefore, $$ \bar{x}=\frac{2(10)+3(15)+1(20)}{2+3+1} =\frac{85}{6} \approx 14.17\text{ minutes}. $$

The mean commute time for these six hypothetical students is about 14.17 minutes. The units remain minutes because the numerator totals minutes across observations and the denominator counts observations.

Why the Formula Works

The frequency-table method is not a different definition of the mean. It is a shorter way to add the same observations. To see why, begin with the raw-data formula: add all \(n\) observations and divide by \(n\). Suppose the distinct observed values are \(x_1,\ldots,x_k\). For each \(i\), let \(f_i\) be the number of observations equal to \(x_i\). The raw-data sum can be divided into groups according to value. The group for \(x_i\) contains \(f_i\) copies of \(x_i\), so its sum is \(f_i x_i\). Adding the group sums gives the total of the raw observations.

Justification: Let \(I_i\) be the set of observation positions whose values equal \(x_i\). These sets partition the \(n\) observation positions, and each set has \(f_i\) positions. Thus, $$ \sum_{j=1}^{n} x_j =\sum_{i=1}^{k}\sum_{j\in I_i}x_j =\sum_{i=1}^{k} f_i x_i. $$ Also, because every observation belongs to exactly one of these groups, \(n=\sum_{i=1}^{k}f_i\). Substituting both identities into \(\bar{x}=(\sum_{j=1}^{n}x_j)/n\) yields the frequency-table formula.

This reasoning depends on the table faithfully representing the data: every observation must be included in exactly one value-frequency pair, and each listed frequency must be the correct count for that value. If those conditions hold, the table and the raw list have the same total and the same number of observations. They must therefore have the same mean.

Worked Example: Hypothetical Waiting Times

A hypothetical clinic records the waiting time, in minutes, for eight appointments. The exact waiting times and their frequencies are shown below.

Waiting time \(x_i\) (minutes)Frequency \(f_i\)Product \(f_i x_i\)
414
6318
8216
12224
Total862

The frequencies add to \(1+3+2+2=8\), agreeing with the stated number of appointments. The weighted sum is \(1(4)+3(6)+2(8)+2(12)=4+18+16+24=62\) minutes.

The mean waiting time is $$ \bar{x}=\frac{62}{8}=7.75\text{ minutes}. $$

Thus, the average waiting time across these eight hypothetical appointments is 7.75 minutes. The value 6 minutes contributes \(3(6)=18\) minutes to the total because it occurred three times, not just once.

Checking and Interpreting the Result

Before interpreting a mean, check that the frequency total is the number of observations represented and that every product has been calculated using the value and frequency in the same row. A useful second check is to compare the result with the smallest and largest listed values. A mean calculated from nonnegative frequencies must be at least as large as the smallest value and no larger than the largest value. If the result falls outside that range, there is an arithmetic or data-entry error.

The mean is expressed in the same units as the original values. In the waiting-time example, dividing a total measured in minutes by a count of appointments gives minutes per appointment, conventionally reported as an average waiting time of 7.75 minutes. The count \(n\) is not the number of distinct values. It is the sum of all frequencies.

Worked Example: Hypothetical Quiz Scores

Suppose a hypothetical class has quiz scores summarized in this frequency table. Each score is an exact observed score, and the table accounts for all students.

Score \(x_i\) (points)Frequency \(f_i\)Product \(f_i x_i\) (points)
702140
804320
903270
1001100
Total10830

The total number of scores is \(n=2+4+3+1=10\). The sum of all score points is \(2(70)+4(80)+3(90)+1(100)=140+320+270+100=830\) points.

Therefore, $$ \bar{x}=\frac{830}{10}=83\text{ points}. $$

The mean score for these ten hypothetical students is 83 points. As a quick check, 83 lies between the smallest recorded score, 70, and the largest, 100. The calculation does not mean that any particular student scored 83; it is the arithmetic average across all ten scores.

Common Mistakes

  • Dividing by the number of rows. In the score example there are four distinct values but ten observations. The denominator is \(2+4+3+1=10\), not four.
  • Adding the values without accounting for their frequencies. The average of the four listed score values, \((70+80+90+100)/4=85\), gives each distinct score equal weight. That is not the mean of the ten students because the score of 80 occurred four times while the score of 100 occurred once.
  • Multiplying incorrectly or omitting a row. Write each product \(f_i x_i\) explicitly, then add the products. A missing product changes the total even if the frequency total is correct.
  • Reporting a result without units or context. State what was averaged and its units, such as “the mean waiting time was 7.75 minutes,” rather than reporting only “7.75.”
  • Assuming a compact table can repair incomplete data. The formula is valid only for the observations represented by the table. If some observations were left out or frequencies are inaccurate, the answer is the mean of the recorded table, not necessarily the intended data set.
Key takeaway: For an exact-value frequency table, multiply each value by its count, add those products, and divide by the sum of the counts. The frequencies preserve the repeated observations, so this calculation gives the same arithmetic mean as the full raw-data list.

Check Your Understanding

Try these questions before reviewing the worked calculations.

  1. A hypothetical data set has values 2, 5, and 9 with frequencies 3, 2, and 1. What is the total number of observations, and what is the mean?
  2. A table has seven distinct values and frequencies that sum to 24. Which number belongs in the denominator when calculating the mean, and why?
  3. Explain why a value with frequency 4 contributes \(4x\), rather than just \(x\), to the sum of the observations.
  4. A learner divides the sum of the values in a frequency table by the number of rows. What does this calculation fail to account for?
  5. If all listed values are between 12 and 30, can a correctly calculated mean from nonnegative frequencies be 34? Explain.