Tutorials › Introduction to Statistics › Calculating the Mean from Raw Data

Center, Spread and Position · Tutorial 147 of 996

Calculating the Mean from Raw Data

Calculate the arithmetic mean directly from raw observations and explain what the result represents in the original units.

Beginner 8 min read

What You'll Learn

  • Identify the observations and their count in a raw data set
  • Calculate the sample mean by summing every value and dividing by the number of values
  • Distinguish the sample mean from the population mean
  • Track units through a calculation and interpret the mean in context
  • Check a calculation using the total and the mean
  • Recognize common counting, addition, and unit mistakes

From a List of Values to a Mean

The mean gives one numerical summary of the center of a set of quantitative observations. The earlier material on the mean as a balance point gives an intuitive picture of this summary. Here the goal is practical: given the individual values themselves, calculate the mean accurately and explain what the answer says in the original measurement units.

For a raw data set, start by identifying every observation that belongs in the calculation. Add all of those values, then divide by the number of observations—not by the largest value, the number of distinct values, or the number of units represented in the measurements. The calculation is simple, but keeping track of the observations and their count is essential.

Definition: For \(n\) quantitative observations \(x_1,x_2,\ldots,x_n\), the sample mean is their sum divided by their count:
$$ \bar{x}=\frac{x_1+x_2+\cdots+x_n}{n} =\frac{\sum_{i=1}^{n}x_i}{n}. $$
The notation \(x_i\) denotes the \(i\)th observation, \(n\) is the number of observations, and \(\bar{x}\) is the sample mean. If the values are measurements on every member of a population of size \(N\), the population mean is \(\mu=\frac{\sum_{i=1}^{N}x_i}{N}\).

The formula applies whether the data are written in the original order, sorted, or displayed in a list. Each observation contributes once to the sum and once to the count. If the same value occurs several times, each occurrence is still an observation and must be included. The mean need not equal one of the values in the data; it is a summary calculated from all of them.

A Reliable Calculation Routine

A clear written setup helps prevent small errors from changing the result. In particular, it separates the total from the count and makes the units visible. For a raw list, use the following sequence.

1
List the observations.
Check which values are included in the data set, and count each observation once.
2
Find the total.
Add every value, retaining enough digits during the calculation to avoid unnecessary rounding.
3
Divide by the count.
Divide the total by \(n\), the number of observations in the list.
4
Report and interpret.
Round appropriately, state the measurement units, and describe the result in the setting that produced the data.

The answer has the same measurement units as the observations. If each observation is a time in minutes, the mean is a time in minutes; if each observation is a mass in grams, the mean is a mass in grams. This follows because the total has units of “observation units,” and dividing by a count, which has no measurement units, leaves the original units.

Worked Example: Mean Quiz Score

Suppose, in a hypothetical practice exercise, five students receive quiz scores of 72, 81, 88, 91, and 93 points. Calculate and interpret the mean score.

There are \(n=5\) observations. Their total is \(72+81+88+91+93=425\) points.

Substitute the total and count into the formula:

$$ \bar{x}=\frac{72+81+88+91+93}{5} =\frac{425}{5} =85\text{ points}. $$

The mean quiz score for these five students is 85 points. It is a summary of the five scores, not a claim that every student earned 85 points. In this example, 85 happens to be an integer, but a mean can also fall between possible recorded scores.

A quick check is to multiply the calculated mean by the number of observations: \(85\times5=425\), which matches the total. This check does not replace the calculation, but it can reveal a division or transcription error.

Count Every Observation

The denominator in the formula is the number of observations, including repeated values. Counting distinct values instead would change the question: it would treat a value recorded several times as though it appeared only once. Similarly, a list with six measurements has six observations even if several measurements happen to be equal. The count is determined by the data collection, not by how many different numbers appear.

When adding by hand, it can help to group values in convenient pairs or subtotals. Addition gives the same total regardless of the order of the values, so rearranging a list for easier arithmetic is valid. But a convenient arrangement must not cause a value to be dropped or counted twice.

Worked Example: Repeated Measurements

In a hypothetical exercise, a device records the following five temperatures, in degrees Celsius: \(18, 20, 20, 21, 26\). Calculate the mean temperature.

The value 20 occurs twice, so it appears twice in both the sum and the count. There are five observations, not four distinct values. The total is \(18+20+20+21+26=105\) degrees Celsius.

$$ \bar{x}=\frac{18+20+20+21+26}{5} =\frac{105}{5} =21^\circ\text{C}. $$

The mean of these five recorded temperatures is \(21^\circ\text{C}\). The repeated 20-degree reading is not a reason to remove one observation: each reading contributes to the data set as recorded.

To see why the count matters, dividing the same total by the four distinct values would give \(105/4=26.25\), which is not the mean of the five readings. It results from using a denominator that does not match the observations included in the total.

Why the Formula Divides by the Count

The division by \(n\) can be understood as finding an equal share of the total. Let \(S=x_1+x_2+\cdots+x_n\) be the sum of \(n\) observations. If that total were represented by \(n\) equal values, each equal value \(m\) would have to satisfy \(nm=S\). Solving this equation gives \(m=S/n\), exactly the formula for \(\bar{x}\). This equal-share view explains why the count of observations is the divisor.

There is also a useful algebraic check connected to the balance-point interpretation. Starting from the definition of \(\bar{x}\), the sum of deviations from the mean is

$$ \sum_{i=1}^{n}(x_i-\bar{x}) =\sum_{i=1}^{n}x_i-\sum_{i=1}^{n}\bar{x} =\sum_{i=1}^{n}x_i-n\bar{x} =\sum_{i=1}^{n}x_i-n\left(\frac{\sum_{i=1}^{n}x_i}{n}\right) =0. $$

Thus the positive and negative differences from the mean balance in total. This identity is a consequence of the formula, and it can help verify an answer: a proposed mean should make the deviations sum to zero, apart from small rounding differences if the mean has been rounded.

Worked Example: Mean Daily Travel Time

Suppose a hypothetical commuter records travel times of 12.5, 15.0, 17.5, and 19.0 minutes on four days. Calculate the mean daily travel time and check the result using deviations.

The observations are in minutes, and \(n=4\). Their total is \(12.5+15.0+17.5+19.0=64.0\) minutes.

$$ \bar{x}=\frac{12.5+15.0+17.5+19.0}{4} =\frac{64.0}{4} =16.0\text{ minutes}. $$

The mean travel time across the four recorded days is 16.0 minutes. To check the balance of the deviations, subtract 16.0 from each observation: \(12.5-16.0=-3.5\), \(15.0-16.0=-1.0\), \(17.5-16.0=1.5\), and \(19.0-16.0=3.0\) minutes. Their sum is \(-3.5-1.0+1.5+3.0=0\) minutes, as expected.

This check uses the unrounded mean of the data. If a result were reported to fewer decimal places, deviations calculated from that rounded result might not sum exactly to zero.

Keep Units and Context Attached to the Answer

A bare numerical answer is often incomplete. Writing “16.0” does not say whether the value is minutes, kilograms, or points, nor does it identify the group or measurements summarized. A contextual interpretation names both the quantity and the observations to which it refers: for example, “The mean travel time across the four recorded days is 16.0 minutes.”

The reported precision should also reflect the arithmetic and the measurement context. Keep the observed values as given during the calculation, divide using the full total, and round the final answer to a sensible number of significant figures or decimal places. Rounding intermediate sums can introduce avoidable error. The mean does not create more measurement precision than the data support.

If the values have different units, do not add them directly to calculate a mean. For instance, a time recorded in minutes and a time recorded in seconds must first be expressed in a common unit. Likewise, make sure every value belongs to the same quantity and set of observations before combining them.

Common Mistakes

  • Dividing by the wrong number. The divisor is the number of observations included in the sum. It is not necessarily the number of distinct values or the largest value in the list.
  • Leaving out repeated values. Repeated measurements are still separate observations. Include each occurrence in the total and the count.
  • Adding incompletely. A missing or duplicated value changes the total. A tidy list, subtotals, and the check \(n\bar{x}=\sum_{i=1}^{n}x_i\) can help catch errors.
  • Dropping the units or context. Report what the mean measures and for which observations, such as the mean score for the five students or the mean time across four days.
  • Rounding too early. Retain the given values and full arithmetic until the final result, then round once to a sensible precision.
Key takeaway: For raw observations, calculate the mean by adding every value and dividing by the number of values. Then report the result in the original units and interpret it as a summary of the observations that were included.

Check Your Understanding

Try these questions before moving on.

  1. For the raw values 6, 8, 9, and 13, what is the count, the total, and the mean?
  2. A list contains the measurements 4, 4, 7, and 10. Explain why the divisor for the mean is four rather than three.
  3. Five hypothetical plants have heights of 12, 15, 15, 18, and 20 centimeters. Calculate the mean height and interpret it in context.
  4. Explain why the mean of measurements recorded in centimeters is also expressed in centimeters.
  5. What relationship between the sum, the count, and the mean can be used to check a calculation?