Why Compare the Mean and Median?
A single summary of claim amounts can hide an important feature of the data: whether most observations are similar or whether a few unusually large or small values pull the distribution in one direction. The mean uses every value and is sensitive to their magnitudes. The median uses the middle position in the ordered data and is less affected by an extreme value that remains at one end. Comparing the two helps describe the center and raises useful questions about skewness.
These summaries are descriptive: they report the center of the observed values. Neither one, by itself, establishes why the data have a particular shape or whether an unusual claim is erroneous. Context and data checks remain important.
Both summaries are expressed in the same units as the data. If a vector contains claim amounts in dollars, its mean and median are in dollars. In R, mean(x) calculates the arithmetic mean and median(x) calculates the median. These functions summarize the supplied values; they do not decide whether the values are representative or whether an unusual value is valid.
Calculating the Center in R
Consider a numeric vector of observed claims. The calculations can be checked in two ways: calculate the results from the values, then verify them with R. For example, if claims contains seven amounts, the commands mean(claims) and median(claims) return the two summaries. R does not require the vector to be sorted before calling median().
For a hand calculation, keep the count and units visible. To calculate a mean, add all observations and divide by the number of observations. To calculate a median, sort the values and identify the central position or positions. Do not confuse the central observation with an average of all observations; averaging every value calculates the mean, not the median.
Worked Example: A Large Claim Pulls the Mean Upward
A hypothetical insurer records seven claim amounts, in dollars: 120, 150, 180, 210, 240, 300, and 900. Calculate the mean and median, interpret their difference, and check what happens if the largest claim is replaced by 1,800 dollars.
Method. Calculate the mean from the sum and count. For the median, use the fourth value because there are seven ordered observations, so the median position is \((7+1)/2=4\).
Original mean. The sum is \(120+150+180+210+240+300+900=2{,}100\) dollars. There are seven claims, so the mean is \(2{,}100/7=300\) dollars.
Original median. The values are already in increasing order. The fourth value is 210 dollars, so the median is 210 dollars. The mean exceeds the median by \(300-210=90\) dollars. The unusually large observation is consistent with a right tail pulling the mean upward, but this comparison alone does not prove the full distribution is right-skewed.
Replace the largest claim. Replacing 900 by 1,800 increases the sum by 900 dollars, from 2,100 to 3,000. The new mean is \(3{,}000/7=428.571\ldots\) dollars, or $428.57 to the nearest cent. The ordered values still have 210 dollars in fourth position, so the median remains $210. The check confirms that the changed extreme value moves the mean substantially while leaving the median unchanged. The common mistake this avoids is assuming both measures respond equally to a larger observation.
In R, mean(c(120, 150, 180, 210, 240, 300, 900)) returns 300, and median(c(120, 150, 180, 210, 240, 300, 900)) returns 210.
What the Mean–Median Difference Can Tell You
A mean noticeably above the median may be consistent with a long or influential upper tail: some large values raise the mean while the middle ordered observation stays lower. A mean noticeably below the median may be consistent with a lower tail pulling the mean down. When the distribution is reasonably balanced around its center, the mean and median are often close.
These are clues, not rules that determine the shape. A mean equal to a median does not guarantee symmetry, and a difference between them does not identify the cause. A small sample, a few extreme values, or a mixture of distinct groups can all affect the comparison. Use the summaries to ask what to inspect next; do not label a distribution solely from the sign of the difference.
Why an Extreme Value Affects the Mean More
The sensitivity of the mean follows directly from its formula. If a data set has \(n\) observations with mean \(\bar{x}\), its total is \(n\bar{x}\). Add one new observation \(z\). The new mean is the old total plus \(z\), divided by the new count \(n+1\):
Subtracting the original mean gives the change:
Thus, the mean moves toward the added value; the farther \(z\) is from the old mean, the larger the change. The divisor \(n+1\) moderates that change, but does not remove the influence of a very large or small value. This derivation applies to finite numerical observations when the new value is included with equal weight.
The median behaves differently because its value depends on rank, not on the distance between observations. If an extreme observation is added at the high end, the middle position may stay at the same value or move to a neighboring value, depending on the original sample size. If an extreme value is changed while it remains at the same end and the ordering of the middle observations is unchanged, the median can remain exactly the same. It is therefore more resistant to extreme magnitudes, but it is not guaranteed to be unchanged by every addition or removal.
Worked Example: Comparing the Two Centers Before and After Adding a Claim
A hypothetical set of six claim amounts, in dollars, is 40, 50, 60, 70, 80, and 90. A seventh claim of 390 dollars is then observed. Calculate both summaries before and after adding it, and quantify how far the two centers separate.
Method. Calculate each mean from its sum and count. For each median, locate the middle value or average the two middle values according to the sample size.
Before the new claim. The sum is \(40+50+60+70+80+90=390\) dollars. The mean is \(390/6=65\) dollars. The two middle values are 60 and 70, so the median is \((60+70)/2=65\) dollars.
After the new claim. The new sum is \(390+390=780\) dollars, and the count is seven. The mean is \(780/7=111.428\ldots\) dollars, or $111.43 to the nearest cent. The ordered values are 40, 50, 60, 70, 80, 90, and 390; the fourth value is 70 dollars, so the median is $70.
Check and interpretation. The mean rises by \(111.428\ldots-65=46.428\ldots\) dollars, or $46.43 to the nearest cent. The median rises by only \(70-65=5\) dollars. The new mean exceeds the new median by \(111.428\ldots-70=41.428\ldots\) dollars, or $41.43. The large claim has a stronger effect on the mean. A common mistake is to use the old even-sample rule after adding the seventh value; with seven observations, the median is one middle value, not the average of two.
When the Mean Is Below the Median
A small observation can pull the mean below the median, just as a large observation can pull it above. The direction of the difference is informative about the influence of the values, but it should be interpreted in context. For claim amounts, a low value may be valid, and a large value may also be valid. A difference is a reason to examine the data and the way claims were recorded, not a reason to automatically discard observations.
Worked Example: A Small Observation Pulls the Mean Downward
A hypothetical portfolio has seven claim amounts, in dollars: 10, 160, 170, 180, 190, 200, and 210. Calculate the mean and median. Explain what the comparison suggests, and state one conclusion it does not justify.
Method. Use the sum divided by seven for the mean. Since there are seven already ordered observations, use the fourth value for the median.
Mean. The sum is \(10+160+170+180+190+200+210=1{,}120\) dollars. Therefore, the mean is \(1{,}120/7=160\) dollars.
Median. The fourth observation is 180 dollars, so the median is 180 dollars. The mean is \(180-160=20\) dollars below the median. The unusually small value is consistent with a lower tail pulling the mean downward.
Check and interpretation. The calculations use all seven values for the mean and the fourth ordered value for the median. The comparison does not justify claiming that every claim is low or that the 10-dollar claim is an error. It only describes the relationship between these two centers and suggests which observations merit contextual review. In R, the corresponding calls are mean(c(10, 160, 170, 180, 190, 200, 210)), which returns 160, and median(c(10, 160, 170, 180, 190, 200, 210)), which returns 180.
Common Mistakes and Practical Checks
A sound comparison depends on calculating both summaries from the same observations and in the same units. Check the count used in the mean, and check whether the median calculation uses one middle value or two. In R, also be aware that missing values affect the function call: by default, mean() and median() return NA if the input contains a missing value. If the analysis intends to omit missing observations, specify na.rm = TRUE, for example mean(x, na.rm = TRUE), and make that choice consistently. Omitting missing values changes which observations are being summarized; it should not be done without considering why values are missing.
- Do not infer symmetry from equality. Equal mean and median do not prove that the data are symmetric.
- Do not call an observation an error because it is extreme. Check whether it is valid and consistent with the intended population before changing or removing it.
- Do not compare summaries from different subsets without saying so. A mean calculated after omitting missing values and a median calculated from all available values may use different records.
- Do not confuse a clue with a diagnosis. The mean–median difference suggests how values may be influencing the center; it does not establish the distribution’s shape or explain the cause.
In exploratory analysis, report the mean and median with their units and, when useful, their difference. If they are far apart, consider whether a few observations or a longer tail are responsible and whether the values are plausible. The aim is not to select one universally correct center: it is to describe the data accurately for the question being asked.
Check Your Understanding
For each problem, calculate the requested summaries and interpret the comparison where asked.
- A hypothetical set of five claim amounts, in dollars, is 2, 4, 6, 8, and 10. Calculate the mean and median. (Answer: mean = $6; median = $6.)
- A hypothetical set of five repair costs, in dollars, is 3, 5, 7, 9, and 31. Calculate the mean and median, and state which is larger. (Answer: mean = $11; median = $7; the mean is larger.)
- Six hypothetical claim amounts, in dollars, are 100, 110, 120, 130, 140, and 150. Calculate the mean and median, showing how the even sample size affects the median. (Answer: mean = $125; median = \((120+130)/2=$125\).)
- A hypothetical set of seven amounts, in dollars, is 0, 20, 30, 40, 50, 60, and 70. Calculate the mean and median to the nearest cent, and describe the direction of their difference. (Answer: mean = $38.57; median = $40; the mean is below the median.)
- A hypothetical set of five amounts, in dollars, is 4, 6, 8, 10, and 12. Replace 12 with 52. Calculate the new mean and median, compare them with their original values, and identify which center changed more. (Answer: original mean and median = $8; new mean = $16; new median = $8; the mean changed more.)