What Is the Sample Mean?
The sample mean (x̄) is the arithmetic average of a sample: the sum of the values divided by the number of values.
The sample mean estimates the population mean (μ), the average of every member of the population. The sample mean is an unbiased estimator, so across many samples its average equals μ. Pierre-Simon Laplace and Abraham de Moivre studied how sample means behave, which led to the Central Limit Theorem. The sample mean is the starting point of the one-sample test in the Z Test Calculator.
Sample Mean Formula (x̄ = Σx / n)
Σx is the sum of all values and n is the number of values. For the values 4, 7 and 10: x̄ = 21 / 3 = 7.
How to Use the Sample Mean Calculator
To use the sample mean calculator, paste or type the data, separated by commas, spaces or new lines.
The calculator shows the mean, the sum, the count, the median, the sample standard deviation and the standard error of the mean. The balance-beam chart stacks the values on a number line with a fulcrum at the mean: the deviations on the left exactly cancel the deviations on the right.
How to Calculate the Sample Mean by Hand
To calculate the sample mean by hand, follow 3 steps:
- Add up all the values to get Σx.
- Count the values to get n.
- Divide Σx by n.
Sample Mean vs. Population Mean
The sample mean (x̄) describes a sample, while the population mean (μ) describes the whole population.
| Sample mean | Population mean | |
|---|---|---|
| Symbol | x̄ | μ |
| Formula | Σx / n | Σx / N |
| Known? | calculated from data | usually unknown |
| Varies? | changes from sample to sample | fixed |
Weighted Mean and Mean of Grouped Data
A weighted mean multiplies each value by its weight before averaging: x̄w = Σ(w × x) / Σw. A course grade with a 40% exam (score 80) and 60% coursework (score 90) has a weighted mean of 0.4 × 80 + 0.6 × 90 = 86.
The mean of grouped data uses class midpoints as values and class frequencies as weights. For classes 0–10 (5 values), 10–20 (8 values) and 20–30 (7 values), the mean is (5 × 5 + 15 × 8 + 25 × 7) / 20 = 16.
Sampling Distribution of the Sample Mean
The sampling distribution of the sample mean is the distribution of x̄ across all possible samples of size n. The sampling distribution is centred on μ and has a spread equal to the standard error.
Standard Error of the Mean (σ/√n)
The standard error of the mean (SEM) is σ / √n, estimated by s / √n. The SEM shrinks as n grows: 4 times the sample halves the SEM. Calculate s from raw data with the standard deviation calculator.
The Central Limit Theorem
The Central Limit Theorem (CLT) states that the sampling distribution of x̄ is approximately normal for large samples, whatever the shape of the population. A sample of 30 or more is the usual rule of thumb. The CLT is the reason z-tests and confidence intervals for means work with non-normal data.
Sample Mean Example: Daily Website Visits
A website records daily visits for one week: 1,240, 1,180, 1,320, 1,410, 980, 1,050 and 1,360.
- SumΣx = 8,540
- Countn = 7
- Sample meanx̄ = 8,540 / 7 = 1,220 visits per day
- Median1,240
- Sample SDs = 160.31
- Standard errorSEM = 160.31 / √7 = 60.59
FAQs
When is the median better than the mean?
The median is better than the mean for skewed data or data with outliers, such as incomes or house prices. One very large value pulls the mean up but leaves the median unchanged. Report both when they differ by a lot.
How do outliers affect the sample mean?
An outlier pulls the sample mean toward itself by (outlier − x̄) / n. Adding a value of 5,000 to the 7 daily visit counts raises the mean from 1,220 to 1,692.5, while the median moves only from 1,240 to 1,280.
Is the sample mean always the same as the population mean?
No, the sample mean differs from the population mean in almost every sample. The gap is sampling error, and the standard error measures its typical size. A confidence interval gives a range for μ; build one with the confidence interval calculator.
How do I calculate the mean in Excel?
Use =AVERAGE(range) in Excel or Google Sheets. =AVERAGE(A2:A8) returns the sample mean. For a weighted mean, use =SUMPRODUCT(values,weights)/SUM(weights).
How do I use the sample mean in a z-test?
Use the sample mean as x̄ in z = (x̄ − μ₀) / (σ / √n). Enter x̄, σ, n and the hypothesized mean μ₀ in the one sample z test calculator.