AI Glossary / Statistics and probability / Intermediate
Sample mean
Definition
The sample mean is the arithmetic average of the observed values of a numeric variable. For n observations x1 through xn, it is written x-bar and calculated as their sum divided by n. It describes the sample's central level and, under suitable sampling assumptions, can estimate the corresponding population mean.
What it means
The mean gives every observation equal weight in the ordinary unweighted calculation. It is the value that would result if the total measured amount were spread evenly across the observations.
It need not be an actual observed value or a good description of a typical individual case. In a skewed distribution, a few large values can pull the mean away from the median. Whether that sensitivity is useful or problematic depends on the quantity the decision needs.
How it works
Define what each observation represents and ensure the values use comparable units. Average order value, average spending per customer, and average daily revenue answer different questions even when they come from the same transaction database.
Add the values and divide by the number of included observations. State how missing values, invalid records, and repeated measurements are handled. Silently treating a missing value as zero changes the result and usually changes its meaning.
The sample deviations from their mean sum to zero. The mean also minimizes the sum of squared deviations over possible constant centers. These algebraic properties explain its central role in least-squares methods.
For independent identically distributed observations with a finite population mean, the sample mean is unbiased for that mean. If the population variance is finite, its variance is sigma²/n. A familiar estimated standard error is s/sqrt(n), using the sample standard deviation under the corresponding assumptions.
Do not confuse the standard deviation of observations with the standard error of their mean. The first summarizes dispersion of individual values; the second describes sampling uncertainty in the estimated average. Dependence and complex sampling can change the standard-error calculation.
Use a weighted mean when the design or target requires unequal contributions. The formula sum(wi xi)/sum(wi) is not automatically equivalent to the unweighted mean. Specify whether weights reflect population representation, frequency, time exposure, or another purpose.
Combine group means using their appropriate counts or weights. Simply averaging the averages of differently sized groups gives each group equal influence, which may not represent the mean across all observations.
Interpret the result with other information. A mean can hide multimodality, outliers, subgroup disparities, or changes over time. For AI training and evaluation, ensure that an average loss or score is calculated at the unit relevant to the deployment decision rather than dominated unintentionally by high-volume users.
Three practical examples
- Service operations: a manager calculates average handling time across comparable completed cases.
- Model evaluation: researchers summarize a per-example loss over a defined test set.
- Survey analysis: analysts estimate an average response, using design weights when the sample does not give each population unit equal representation.
Think of it this way
Think of pooling the total contents of several containers and then distributing the contents equally among them. The resulting level represents the mean. One unusually full container raises that level, even if most containers originally held much less.
Worked example
Five fictional task-completion times are 4, 6, 7, 8, and 15 minutes. Their sum is 40, so the sample mean is 40/5 = 8 minutes. The median is 7 minutes, illustrating that the two summaries need not agree.
The deviations from the mean are −4, −2, −1, 0, and 7. They sum to zero, and their squared values total 70. The sample variance is 70/(5−1) = 17.5 squared minutes.
Under an independent, identically distributed sampling model, the estimated standard error of the mean is sqrt(17.5/5) = sqrt(3.5), approximately 1.871 minutes. This is not the standard deviation of individual completion times.
If the last recorded time changes from 15 to 35 minutes, the total rises to 60 and the mean becomes 12 minutes. The arithmetic illustrates sensitivity to an extreme observation; it does not justify removing a valid slow case.
Illustrative case study
Fictional case: Ashford Helpdesk reports a falling average resolution time after introducing an AI assistant. A review shows that the case mix has also changed, with more simple tickets in the later period.
The team presents the overall mean alongside ticket-type summaries and investigates whether the comparison is fair. It does not treat the average's change alone as a causal estimate of the assistant's effect or as proof that every customer receives faster service.
Common misconceptions and mistakes
The sample mean is not necessarily the most common value or the median.
Averaging subgroup averages without considering group sizes can answer the wrong question.
A larger sample does not remove selection bias merely by stabilizing its mean.
The standard error formula s/sqrt(n) is not universally valid for correlated or complex-survey data.
A before-and-after difference in means can reflect many changes besides the intervention of interest.
Business use
Use the mean when totals and average contribution are meaningful for the decision, such as resource planning or expected workload. Pair it with distribution summaries when individual experience matters. State the observation unit, denominator, timeframe, and weighting so stakeholders can compare results without accidentally mixing different targets.
People also ask
Can the mean lie between observed values?
Yes; it need not equal any observation.
Can it lie outside the observed range?
An ordinary finite arithmetic mean cannot.
Does multiplying every value by a constant multiply the mean?
Yes; unit conversions carry through directly.
Does the mean resist outliers?
No; large values can strongly influence it.
Check your understanding
Answer: Two teams have 10 cases averaging 4 minutes and 30 cases averaging 8 minutes.
What is the combined mean?
Answer: (10×4+30×8)/40 = 7 minutes, not 6.
Why does the worked example's mean rise when one value becomes larger?
Answer: The total increases while the count stays fixed.
Related terms
- Median
- Sample variance
- Standard error
- Law of large numbers
- Central limit theorem
- Population mean
- weighted mean
Learn next
Calculate a mean and median for a small dataset, then recompute after one observation changes. Next combine two unequal-sized groups and compare the correctly weighted mean with the unweighted average of group means.
More in Statistics and probability
- Sample complexity - Sample complexity describes how many observations a learning or estimation procedure needs to meet a specified performance criterion under stated assumptions.
- Sample covariance matrix
- Sample frame - A sample frame, more commonly called a sampling frame, is the list, map, register, or other operational device used to identify and access units for sample...
- Sample ratio mismatch - Sample ratio mismatch, abbreviated SRM, is a statistically significant discrepancy between the observed numbers of experimental units in treatment groups...
- Sample rotation - Sample rotation is the planned replacement of some or all units in a recurring survey sample after a specified period of participation.
- Sample size - Sample size is the number of units or observations included in a defined sample, usually denoted n.
Sources
NIST/SEMATECH e-Handbook, Measures of Location: https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm NumPy, numpy.mean: https://numpy.org/doc/stable/reference/generated/numpy.mean.html The task-time dataset and helpdesk case are original fictional illustrations.
Previous: Sample frame Next: Sample ratio mismatch