Descriptive statistics

Basic Statistics Guide

Understand center, spread and position with one worked dataset. Compare statistical methods, read accurate charts and separate a z-score from a probability.

Worked calculations · Four original charts · Practice with answers

Check the example dataset

Start with the data and the question

Descriptive statistics summarize the observations you have. A center measure describes a typical location; spread describes variation; a percentile describes position under a stated method. None of these summaries, by itself, establishes cause and effect or guarantees that a sample represents a larger population.

Our illustrative scores, in points, are 2, 4, 4, 6, 92,\ 4,\ 4,\ 6,\ 9. There are n=5n=5 observations, even though only four distinct values appear. Keep both copies of 44: each is a separate observation. The values are already sorted from smallest to largest.

  1. Identify what each observation measures and keep the units consistent. A mean of numerical identification codes has no useful quantitative meaning.
  2. Check missing entries, transcription errors and repeated observations. A missing score is not automatically a zero; a repeated score is not automatically a duplicate record to delete.
  3. State whether you are describing an entire population or using a sample to estimate one. Then choose the summary and, where relevant, the quantile or rank convention.

In the formulas below, xix_i denotes an observation; x(i)x_{(i)} denotes the observation in sorted position ii. The letters nn and NN distinguish sample and population counts, while xˉ\bar{x} and μ\mu distinguish their means.

Basic statistics formulas and the conditions that matter
MeasureFormulaMeaning and convention
Arithmetic meanxˉ=1n∑i=1nxi\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_iUse numerical values with meaningful distances and matching units. nn is the observation count.
Medianmedian⁡=x((n+1)/2)(n odd)\operatorname{median}=x_{((n+1)/2)}\quad(n\text{ odd})Sort first. For even nn, average x(n/2)x_{(n/2)} and x(n/2+1)x_{(n/2+1)}. Parenthesized subscripts denote sorted positions.
RangeR=x(n)−x(1)R=x_{(n)}-x_{(1)}Subtract the minimum from the maximum. This ignores the positions of all interior observations.
Population varianceσ2=1N∑i=1N(xi−μ)2\sigma^2=\frac{1}{N}\sum_{i=1}^{N}(x_i-\mu)^2Use when these NN observations form the complete population being described. μ\mu is that population's mean.
Sample variances2=1n−1∑i=1n(xi−xˉ)2s^2=\frac{1}{n-1}\sum_{i=1}^{n}(x_i-\bar{x})^2Requires n≥2n\ge2. This is the usual corrected estimator of population variance from a random sample.
Standard deviationσ=σ2,s=s2\sigma=\sqrt{\sigma^2},\qquad s=\sqrt{s^2}Match the chosen variance convention. Standard deviation has the original measurement unit; variance has its square.
Interquartile rangeIQR⁡=Q3−Q1\operatorname{IQR}=Q_3-Q_1State the quartile method. This guide uses linear interpolation, R7, for its quartiles and box plot.
Standard scorez=x−μσz=\frac{x-\mu}{\sigma}Requires σ>0\sigma>0. A descriptive sample version uses xˉ\bar{x} and s>0s>0. Normality is an additional assumption for normal-model probabilities.

On a narrow screen, swipe the table horizontally or focus it and use the arrow keys. Use your browser's Print command to print the reference or save it as PDF; expand any practice answers you want included.

Statistics summary of five observations: two, four, four, six and nine. Mean five, median four, mode four and range seven.
The guide's example dataset summarized by four measures of center and spread.

Mean, median and mode: work through the same list

See every observation diagramFive observations at two, four, four, six and nine. The two fours are stacked. A triangle marks median four; a diamond and dashed guide mark mean five.
00
11
22
33
44
55
66
77
88
99
1010
Triangle: median · Diamond: mean

See every observation

xˉ=5\bar{x}=5median⁡=4\operatorname{median}=4

Each dot is one observation; stacking keeps the repeated value visible. The vertical stacking is a count arrangement, not a second measured variable.

1. Add and divide for the mean

xˉ=2+4+4+6+95=255=5\bar{x}=\frac{2+4+4+6+9}{5}=\frac{25}{5}=5

The mean uses every observation. Its unit is points, just like the original scores. The dot plot retains the repeated value by stacking its dots instead of drawing one dot for each distinct number.

2. Locate the middle for the median

With five observations, the middle sorted position is (5+1)/2=3(5+1)/2=3. The third value is 44, so the median is 44 points. Position three is an index; it is not the median value.

3. Count repetitions for the mode

The value 44 appears twice; each other value appears once. The mode is therefore 44 points. The arithmetic mean and median need not equal the mode.

Check center measures for the example

Even counts and multiple modes

For 2, 4, 6, 82,\ 4,\ 6,\ 8, average the two middle values: (4+6)/2=5(4+6)/2=5. A median can fall between observations. The list 1, 1, 2, 2, 31,\ 1,\ 2,\ 2,\ 3 has two repeated modes, 11 and 22. Under this guide's repeated-mode convention, a list in which every value appears once has no repeated mode. Some software instead reports every maximum-frequency tie; name the convention when that distinction matters.

Try the even-count median

Frequency tables keep repeated observations

The same dataset can be stored as distinct values 2,4,6,92,4,6,9 with frequencies 1,2,1,11,2,1,1. Multiply each value by its frequency fif_i, then divide by the total frequency. Taking an unweighted mean of just the distinct values would change the dataset.

xˉ=∑fixi∑fi=2(1)+4(2)+6(1)+9(1)1+2+1+1=5\bar{x}=\frac{\sum f_i x_i}{\sum f_i}=\frac{2(1)+4(2)+6(1)+9(1)}{1+2+1+1}=5Check the equivalent frequency input

Why the median can be more informative with extremes

Replace the final score 99 with 2929. The mean becomes 45/5=945/5=9, while the median stays 44. This comparison demonstrates sensitivity to the magnitude of an extreme value; it does not prove that the value is an error. Investigate the observation and report the distribution's context before choosing a single summary.

Compare the changed dataset. OpenStax's center-measures chapter explains mean, median, mode and frequency-weighted means.

Range, variance and standard deviation

For the original list, the range is R=9−2=7R=9-2=7 points. Range uses only the endpoints. Variance and standard deviation also use the interior values, by measuring deviations from the relevant mean.

1. Subtract the mean and square each difference

The mean is 55. Subtract it from each observation, then square each signed difference. Keep both rows containing 44; compressing them into a frequency row would require multiplying that row's contribution by its count.

Every observation contributes to the squared-deviation total
Observationxix_ixi−5x_i-5(xi−5)2(x_i-5)^2
122−3-399
244−1-111
344−1-111
4661111
599441616
∑i=15(xi−5)2=9+1+1+1+16=28\sum_{i=1}^{5}(x_i-5)^2=9+1+1+1+16=28

The unsquared deviations add to zero: −3−1−1+1+4=0-3-1-1+1+4=0. Squaring avoids cancellation and gives large deviations more influence. Standard deviation is not the arithmetic average of absolute distances; mean absolute deviation is a different measure.

2. Choose the denominator for the question

The five values are the whole population

σ2=285=5.6\sigma^2=\frac{28}{5}=5.6σ=5.6≈2.3664\sigma=\sqrt{5.6}\approx2.3664Highlight population results

The five values are a sample

s2=285−1=7s^2=\frac{28}{5-1}=7s=7≈2.6458s=\sqrt7\approx2.6458Highlight sample results

Estimating the mean from the same sample leaves n−1n-1 freely varying deviations because their sum is fixed at zero. Dividing by n−1n-1 gives the usual unbiased variance estimator for independent, identically distributed observations with finite variance. Taking its square root does not make sample standard deviation exactly unbiased. The unobserved population variance is not known just because a sample calculation is available.

3. Report units, convention and rounding

Variance is in squared points, while standard deviation and range are in points. Here sample variance and range both have the numerical value 77, but their units and meanings differ. Keep exact fractions and roots until the final display, state whether the result is sample or population based, and round only at the end. See OpenStax's spread definitions.

Percentile values: state the method before calculating

A percentile value starts with a requested percentage and returns a value on the data's scale. Small-sample definitions differ. This guide uses linear interpolation called R7, described in the official R quantile documentation. Let pp be the requested fraction between 00 and 11, rather than the percentage number.

Interpolate between sorted values diagramSorted positions one through five have values two, four, four, six and nine. At position three point four, R7 interpolation between four and six gives four point eight. Horizontal and vertical guides mark the interpolated point.
00
22
44
66
88
1010
11
22
33
44
55
ValueSorted position

Interpolate between sorted values

h=3.4h=3.4Q(0.60)=4.8Q(0.60)=4.8

The gold point lies partway between the third and fourth sorted values. An interpolated percentile need not be an observed value. The horizontal scale is position, not percentage.

Find the sixtieth percentile using R7

  1. Convert 60%60\% to p=0.60p=0.60, then calculate the sorted position.h=1+(n−1)p=1+4(0.60)=3.4h=1+(n-1)p=1+4(0.60)=3.4
  2. The position lies 0.40.4 of the way from the third observation to the fourth. Those values are x(3)=4x_{(3)}=4 and x(4)=6x_{(4)}=6.
  3. Q(0.60)=4+0.4(6−4)=4.8Q(0.60)=4+0.4(6-4)=4.8

The R7 sixtieth percentile is 4.84.8 points. It need not be an observation in the list. At the endpoint probabilities, use the minimum for p=0p=0 and the maximum for p=1p=1 directly; do not interpolate past the data.

Reproduce the R7 percentile

Compare nearest-rank R1

For 0<p≤10<p\le1, the nearest-rank method takes sorted position ⌈np⌉\lceil np\rceil. At p=0.60p=0.60, that is ⌈5(0.60)⌉=3\lceil5(0.60)\rceil=3, so the result is x(3)=4x_{(3)}=4. The zero-percentile endpoint is the minimum. This answer differs from R7 because the rule differs, not because one calculator must be broken.

Compare nearest-rank results. The official R documentation defines nine methods. Match the convention required by your course, report or software workflow, and keep it fixed when comparing datasets.

Percentile ranks: account for ties explicitly

Percentile rank reverses the question: start with a value and count its position relative to observations. For the score 44, there is one observation below it and two equal to it. Write B=1B=1, E=2E=2 and n=5n=5. Three common counting rules give different results.

Strict below: Bn=15=0.20=20%\text{Strict below: }\frac{B}{n}=\frac15=0.20=20\%At or below: B+En=35=0.60=60%\text{At or below: }\frac{B+E}{n}=\frac35=0.60=60\%Midpoint: B+E/2n=25=0.40=40%\text{Midpoint: }\frac{B+E/2}{n}=\frac25=0.40=40\%

These percentages describe different counts. Other conventions, such as average occupied rank, also exist. A percentile value and a percentile rank are not generally exact inverse operations on a finite dataset, especially with ties or interpolation. Record the rule alongside the number.

Check the midpoint rank and compare tie rules

Quartiles, interquartile range and box plots

R7 quartiles and box plot diagramA box from first quartile four to third quartile six, with median four coinciding with its left edge. Whiskers end at observed values two and nine. All five observations are inside or on the stated fences.
00
22
44
66
88
1010
Median coincides with the left box edge

R7 quartiles and box plot

Q1=4, Q2=4, Q3=6Q_1=4,\ Q_2=4,\ Q_3=6IQR⁡=2\operatorname{IQR}=2

The thick median line is also the box's left boundary. Whiskers end at observed values, not automatically at the fences. Small tied datasets need not put exactly half the observations inside the box.

Using R7 throughout, the quartile positions for this list are 22, 33 and 44. Therefore Q1=4Q_1=4, Q2=4Q_2=4 and Q3=6Q_3=6. The median equals the first quartile here because of repeated values; its line correctly coincides with the left edge of the box.

IQR⁡=Q3−Q1=6−4=2\operatorname{IQR}=Q_3-Q_1=6-4=2

For the common outside-fence screening rule, calculate the lower and upper fences using 1.51.5 times the IQR.

L=Q1−1.5IQR⁡=4−3=1L=Q_1-1.5\operatorname{IQR}=4-3=1U=Q3+1.5IQR⁡=6+3=9U=Q_3+1.5\operatorname{IQR}=6+3=9

Flag observations strictly below 11 or strictly above 99. The maximum is exactly 99, so it is not outside the fence. The whiskers end at observed values 22 and 99, not at arbitrary points on the axis.

Quartile definitions can change a small-sample box plot. A median-of-halves method that excludes the overall median would instead give Q1=3Q_1=3 and Q3=7.5Q_3=7.5 for this list. The linked calculator presets explicitly select R7 to match this guide. With ties, the interval between quartiles need not contain exactly half the recorded observations.

The NIST box-plot reference explains fences and whiskers. This guide includes observations exactly on a fence, matching the no-more-than-distance rule in the R box-plot documentation; its quartile estimator is stated separately. Treat an outside-fence point as a reason to investigate, not an automatic instruction to delete it.

A z-score measures standardized distance

A z-score subtracts a reference mean and divides by a positive reference standard deviation. It can be calculated for nonnormal data. For a separate score of x=82x=82 points, reference mean μ=70\mu=70 points and standard deviation σ=8\sigma=8 points, follow three steps.

  1. Subtract the reference mean: 82−70=1282-70=12 points.
  2. z=x−μσ=82−708=1.5z=\frac{x-\mu}{\sigma}=\frac{82-70}{8}=1.5
  3. Interpret the result as 1.51.5 standard deviations above the mean. The matching units cancel, so the score is dimensionless. It is not 1.5%1.5\% and is not itself a percentile.

Using a sample's own mean and standard deviation gives the descriptive standardized value (x−xˉ)/s(x-\bar{x})/s when s>0s>0. In either version, a positive score is above the reference mean and a negative score is below it. Standardizing changes location and scale; it does not transform a skewed distribution into a normal one.

Check the z-score with normal probabilities switched off. SciPy's standardization documentation describes the mean, standard deviation and denominator convention separately from probability modeling.

A normal probability requires an additional assumption

A separate normal-model example diagramA standard normal density curve on a displayed interval from negative four to four. The region to the left of z equals one point five is shaded. Probability includes the left tail beyond the visible window. This model is not fitted to the five-value dataset.
00
0.10.1
0.20.2
0.30.3
0.40.4
−4-4
−2-2
00
22
44
DensityStandard score

A separate normal-model example

z=1.5z=1.5P(Z≤1.5)≈0.9332P(Z\le1.5)\approx0.9332

This curve assumes a normal distribution; it is not an inference from the five observations. The probability includes the left tail beyond the displayed window. Height is density, while area represents probability.

Now explicitly assume the population of scores follows a normal distribution with mean 7070 and standard deviation 88. Under that model, the standardized random variable ZZ is standard normal. The probability of a score at or below 8282 is the area to the left of z=1.5z=1.5.

P(X≤82)=P(Z≤1.5)=Φ(1.5)P(X\le82)=P(Z\le1.5)=\Phi(1.5)Φ(1.5)≈0.9331928≈93.32%\Phi(1.5)\approx0.9331928\approx93.32\%

Here Φ\Phi is the standard normal cumulative distribution function. The model predicts about 93.32%93.32\% at or below the cutoff. This does not establish an empirical percentile rank in the five-value dataset, which is a separate example with a different center and spread.

The curve is drawn from the standard normal density ϕ(z)=e−z2/2/2π\phi(z)=e^{-z^2/2}/\sqrt{2\pi}. The displayed window is [−4,4][-4,4], but the calculated left-tail probability includes values below the visible window. Curve height is density, not the probability of that single score.

Check the explicitly assumed normal model

Use an observed rank calculation when the question concerns the actual list. Use a normal probability only when the problem supplies or justifies that distributional model. The distinction is explained by the definitions in OpenStax's standard-normal chapter; the standardization arithmetic alone does not supply the assumption.

Practice: calculate, then interpret

Open each answer after trying the calculation. The disclosures work with a keyboard and without JavaScript.

What is the median of 2, 4, 6, 82,\ 4,\ 6,\ 8?

There are four sorted observations, so average the second and third: (4+6)/2=5(4+6)/2=5. The answer is 55, even though no observation equals 55. Choosing only the lower middle value would use a different rule from the numerical median taught here.

What is the sample variance of 4, 4, 44,\ 4,\ 4?

The mean is 44, so every deviation is zero. The squared-deviation total is zero and the sample denominator is 3−1=23-1=2, giving s2=0/2=0s^2=0/2=0. Sample standard deviation is also zero. A z-score using that standard deviation would be undefined.

Standardize 5454 using mean 7070 and standard deviation 88.

Compute z=(54−70)/8=−16/8=−2z=(54-70)/8=-16/8=-2. The value lies two standard deviations below the reference mean. This statement does not require normality. A lower-tail probability would be an additional calculation under an explicitly chosen distributional model.

FAQ

Frequently Asked Questions

Which average should I use: mean, median or mode?
Choose the measure that answers your question. The arithmetic mean uses every numerical value and is useful when a total shared across observations matters. The median locates the center of an ordered list and is less sensitive to the magnitude of extreme observations. The mode identifies the most frequent value or category. Report spread and data context alongside the chosen center; no single average describes every feature.
Why do sample and population standard deviations differ?
For the same nonconstant list, the sample calculation divides the squared-deviation total by n−1n-1, while the population calculation divides by nn. The sample result is therefore larger. The choice depends on whether the list is the entire population of interest or a sample used to estimate a broader population. The usual unbiasedness argument applies to sample variance under independent, identically distributed sampling with finite variance; it does not make the sample standard deviation exactly unbiased.
Is standard deviation the average distance from the mean?
Not the ordinary arithmetic average of absolute distances. Standard deviation comes from squared deviations: average them using the selected denominator and then take the square root. Mean absolute deviation is a different statistic. Squaring gives large deviations more influence. Standard deviation returns to the original unit, whereas variance uses squared units, so a score variance measured in squared points should not be described as a number of points.
Why do percentile calculators sometimes disagree?
Small samples, interpolation rules and repeated values can produce different answers under legitimate definitions. In this guide's five-value dataset, R7 gives the sixtieth percentile as 4.84.8, while nearest-rank R1 gives 44. Neither number should be substituted silently for the other. Match the method required by your course or analysis, retain all repeated observations, and state the convention with the result so that another person can reproduce it.
Is a percentile rank the same as a percentile value?
No. A percentile value starts with a percentage and returns a value on the data's scale. A percentile rank starts with a value and returns a percentage under a stated counting rule. Ties matter: for the value 44 in the example, strict-below rank is 20%20\%, at-or-below rank is 60%60\%, and midpoint rank is 40%40\%. These operations need not be exact inverses for a finite dataset.
Do z-scores require normally distributed data?
No. Subtracting a mean and dividing by a positive standard deviation is valid for nonnormal data too; it expresses a value's distance in standard-deviation units. What requires an additional model is turning that score into a probability using the standard normal distribution. Standardizing a skewed distribution does not remove its skewness. Use observed rank counts for empirical position, and enable normal-model probabilities only when that model is justified.
What happens with one observation or all identical values?
One observation has population variance zero if that one-item list is the whole population, but sample variance is undefined because its denominator would be zero. Two or more identical observations have zero sample and population variance. A z-score based on zero standard deviation is undefined. An empty dataset has no mean or median. Treat missing or invalid observations explicitly instead of silently replacing them with zeros.
Should an outlier be removed before calculating statistics?
Investigate it first. An unusual value may be a recording error, a different process or a valid observation. A box-plot fence is a screening rule, not proof that a value is wrong. Keep the original record, explain any exclusion and compare summaries with and without it when appropriate. In the guide's R7 box plot, the maximum value lies exactly on the upper fence, so the strict outside-fence rule does not flag it.

Sources and verification

The examples are illustrative, not sampled research findings. Exact rational calculations, squared deviations, percentile conventions, tie counts, chart coordinates and normal probabilities were independently checked. Calculator presets specify the conventions used here, and approximation signs distinguish rounded results.

Related calculators and reading

Editorial Transparency

Who maintains this page

Ownership and review

Written and maintained by the Toolarithm editorial team. The method was last reviewed on . No independent professional review is claimed.

Methodology

The editorial team checks definitions, examples, linked tools, and cited references. Dates shown here come from the page's maintained publication record.

Read the editorial methodology

Dates and sources

Published . Updated .