ARITHMETIC WORKSHEETS

Checking a frequency-weighted mean against an expanded list

A frequency weight says how many times a value occurs, so the weighted mean should match the plain mean of the expanded list. This guide checks 10 occurring twice and 20 occurring three times.

Weights as repeat counts

A table of values with frequencies is a compact way to record repeated observations. Instead of writing 10, 10, 20, 20, 20, you write the value 10 with frequency 2 and the value 20 with frequency 3. The weighted average calculator takes the values and these frequencies as weights, and it computes the sum of value times weight, divided by the sum of weights. Because frequencies are counts, this must agree with the simple mean of the expanded list. Comparing the two is a direct test that the weights were entered correctly and that they mean what you think they mean.

The weighted route

With values 10 and 20 and weights 2 and 3, the products are 10 times 2, which is 20, and 20 times 3, which is 60. Their sum is 80. The weights add to 5. Dividing 80 by 5 gives 16. The weighted average calculator returns a result of 16 and a total weight of 5, as the first case records. The total weight is also the number of observations, which is a useful by-product when the weights are counts. The result of 16 lies between the two values, closer to 20 than to 10, because 20 carries the larger frequency.

The expanded route

Now write out the observations: 10, 10, 20, 20, 20. Their sum is 80 and there are five of them, so the plain mean is 16. The average calculator returns a mean of 16 and a count of 5 for that list, as the second case records. The two routes match term for term. The sum of value times frequency is the sum of the expanded list, since each value appears as many times as its frequency, and the sum of the weights is the length of the list. That identity is why the check works, and it holds for any list with whole-number frequencies.

A larger table

Take test scores 70, 80 and 90 with frequencies 1, 3 and 2. The weighted sum is 70 plus 240 plus 180, which is 490. The total frequency is 6. The mean is 490 divided by 6, about 81.667. Expanding the data gives 70, 80, 80, 80, 90, 90, which sum to 490 over 6 observations, the same mean. The median of the expanded list is 80, because the middle pair is 80 and 80. Ignoring frequencies and averaging the three distinct scores gives 80, a different number. Treating each distinct value as one observation hides the fact that 80 occurred three times.

When the weights are not counts

Not every weight is a frequency. In a course, an exam may count for 70 percent and a quiz for 30 percent. Scores of 80 and 90 with weights 0.3 and 0.7 give a weighted average of 87. There is no expanded list of observations behind that number, because the weights express importance and not repetition. The calculation is the same, the sum of value times weight over the sum of weights, but the interpretation is different. Labeling every weight as a count would lead to the false claim that there were 0.3 of an observation of 80. State what the weights mean alongside the result.

Fractional and scaled weights

Frequencies can be rescaled without changing the weighted mean, provided all are scaled by the same factor. Weights of 2 and 3 give the same result as 4 and 6, or as 0.4 and 0.6. The weighted mean depends only on the ratios between the weights. What changes is the total weight, which is 5, 10 or 1 in those versions. When the weights are counts, the total is the sample size and matters for later calculations such as standard errors. When the weights are proportions, the total is 1 and the mean is read directly. Keeping the original counts retains information that proportions discard.

Zero and negative weights

A frequency of zero means the value did not occur, so it contributes nothing to the sum or to the total weight. A negative weight has no meaning as a count, because an observation cannot occur a negative number of times. Weighted averages with negative weights can leave the range of the data and produce unusual results, so the check here assumes nonnegative weights with a positive total. If every weight is zero, the denominator is zero and the weighted mean is undefined. Entering data from a table, a column of zeros is a sign that the frequencies were copied from the wrong place.

Medians and other statistics from frequency tables

The expanded list also gives the median, mode and range without further formulas. For the table with 10 twice and 20 three times, the median of the expanded list 10, 10, 20, 20, 20 is 20, the middle value of five, and the mode is 20 because it has the highest frequency. The weighted mean of 16 sits between them. Some statistics, such as the median, need cumulative frequencies when the table is large and expanding the list is impractical. The expanded list is a teaching device that is practical for small tables and clarifies what the formulas compute. The mode in particular is read straight from the table as the value with the largest frequency, and a tie between two values gives two modes. For a frequency table of 10 occurring twice and 20 occurring three times, the range is 10, from 10 to 20, regardless of the frequencies.

Using the check on your own data

To test a frequency table, enter the values and frequencies into the weighted average calculator, and write the expanded list into the average calculator. Compare the two means and the total weight against the count. If they disagree, the usual causes are a frequency that was attached to the wrong value, a missing row, or a weight that is not a count. Matching results show that the table and the list describe the same observations. Mismatch tells you to look at the data entry before any later analysis. For a table with many rows, the expanded list can be long, so the check can be run on a sample: pick a subset of rows, expand only those, and compare their weighted and plain means. The scores table is a convenient example, since its weighted mean of about 81.667 and its plain expanded mean agree to every digit shown.

Reproduce the checks

Frequency representation

Open the Weighted average calculator and enter:

Values
10,20
Weights
2,3

Expected output:

Weighted average

16

Total weight

5

The total frequency is five.

Expanded observations

Open the Average calculator and enter:

Values
10,10,20,20,20

Expected output:

Arithmetic mean

16

Number of values

5

Both representations describe the same observations.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks