MLT-110 · Lesson 6 of 12 · 23 min

Basic statistics for the laboratory

▶ Video coming soon A video version of this lesson is on the way.

Every morning the quality control coordinator at Mapleford General Hospital, a technologist named Priyanka Venkataraman, prints a page of numbers that most people in the hospital never see: the control results from the night shift, each beside a mean, a standard deviation and a coefficient of variation. On Noor Haddad's first visit to the quality office, Priyanka handed her ten glucose control results and a calculator. "Before you ever look at a control chart," she said, "calculate the numbers that draw it. Once you've done it by hand, you'll never trust a chart you don't understand."

Statistics is the language the laboratory uses to describe variation. No measurement is perfectly repeatable: the same control material tested twenty times gives twenty slightly different results. Statistics lets the laboratory describe how much variation is normal, recognize when variation becomes abnormal, compare methods, set reference intervals and express how confident it is in a result. This lesson covers the descriptive statistics used every day, the Gaussian distribution, z-scores, reference intervals, standard error, and a short introduction to sensitivity and specificity. Later lessons apply these tools to precision, control charts and method comparison.

Populations and samples

In statistics, a population is the entire set of values you are interested in, and a sample is the subset you actually measure. If you want to know how a glucose control behaves on your analyzer, the population is every result the analyzer would ever produce on that material; your 20 or 30 measurements are a sample. Sample statistics estimate population values, and the estimates get better as the sample gets larger. Statistical symbols distinguish the two: the population mean is written µ (mu) and the population standard deviation σ (sigma); the sample mean is written x̄ (x-bar) and the sample standard deviation s or SD.

Measures of central tendency

The mean (arithmetic average) is the sum of the values divided by the number of values: x̄ = Σx ÷ n, where Σ (capital sigma) means "the sum of" and n is the number of values. The mean uses every value, which makes it efficient but also sensitive to outliers.

The median is the middle value when the values are arranged in order. With an odd number of values it is the central one; with an even number it is the average of the two central values. The median is not affected by extreme values, which makes it useful for skewed data such as many hormone or enzyme results in healthy people.

The mode is the most frequent value. It is used mainly to describe the shape of a distribution: a distribution with two peaks is called bimodal, which may indicate that two different populations have been mixed, for example results from males and females for a sex-dependent analyte.

Measures of dispersion

The range is the difference between the highest and lowest values. It is simple but depends on only two values and grows as more values are collected, so it is a poor measure of variation for large data sets.

The standard deviation (SD) describes how widely values spread around the mean. For a sample, SD = √[Σ(x − x̄)² ÷ (n − 1)]. In words: subtract the mean from each value, square each difference, add the squares, divide by one less than the number of values, and take the square root. Dividing by n − 1 rather than n, known as Bessel's correction, compensates for the fact that a sample's values sit slightly closer to their own mean than to the true population mean. The quantity before the square root is the variance (SD²). Variances, not SDs, add together when independent sources of variation combine, a fact used later when total error is calculated.

The coefficient of variation (CV) expresses the SD as a percentage of the mean: CV = (SD ÷ mean) × 100. Because it is relative, the CV lets you compare the imprecision of methods or control levels with different means, or even different units. An SD of 0.15 mmol/L means more at a mean of 2.5 than at a mean of 25; the CVs, 6 percent and 0.6 percent, show the difference immediately.

Calculating mean, SD and CV by hand

Ten glucose control results and their deviations from the mean
Result (mmol/L)Deviation from mean (x − x̄)Squared deviation
5.2−0.050.0025
5.40.150.0225
5.1−0.150.0225
5.30.050.0025
5.50.250.0625
5.2−0.050.0025
5.30.050.0025
5.0−0.250.0625
5.40.150.0225
5.1−0.150.0225
Sum: 52.5Sum: 0.00Sum: 0.2250

Worked problem

Mean, SD and CV for the glucose control

Using the ten results in the table, calculate the mean, median, range, SD and CV.

Show solution
  1. Mean = 52.5 ÷ 10 = 5.25 mmol/L. The deviations from the mean add to zero, as they always do, which is a useful check.
  2. Median: in order, the values are 5.0, 5.1, 5.1, 5.2, 5.2, 5.3, 5.3, 5.4, 5.4, 5.5. The two central values are 5.2 and 5.3, so the median is 5.25 mmol/L. Range = 5.5 − 5.0 = 0.5 mmol/L.
  3. Variance = sum of squared deviations ÷ (n − 1) = 0.2250 ÷ 9 = 0.0250.
  4. SD = √0.0250 = 0.158 mmol/L.
  5. CV = (0.158 ÷ 5.25) × 100 = 3.0 percent.

Answer: Mean 5.25 mmol/L, median 5.25 mmol/L, range 0.5 mmol/L, SD 0.16 mmol/L and CV 3.0 percent. In practice, a laboratory would use at least 20 results collected over many days before setting control limits, as Lesson 8 explains.

Calculators and spreadsheets compute SD instantly, but they often offer two versions. The sample SD divides by n − 1 and is the one used for laboratory quality control. The population SD divides by n and gives a slightly smaller value. Check which one your tool reports; with 20 values, the difference is about 2.5 percent, enough to shift control limits.

The Gaussian distribution

When many small, independent, random influences add up, as they do in repeated measurements of a stable control material, the results tend to follow a symmetrical, bell-shaped curve called the Gaussian or normal distribution. A Gaussian distribution is completely described by its mean and SD. The mean sets the center, and the SD sets the width.

A bell-shaped curve centered on the mean. Vertical lines mark the mean and plus and minus one, two and three standard deviations. Shaded bands show that about 68.3 percent of results fall within plus or minus 1 SD, about 95.4 percent within plus or minus 2 SD and about 99.7 percent within plus or minus 3 SD. Small labels on the tails note that about 4.6 percent of results fall outside 2 SD and about 0.3 percent outside 3 SD.
Figure 1. The Gaussian distribution. The proportions within 1, 2 and 3 standard deviations of the mean are the basis of control limits.

The key property of the Gaussian distribution for quality control is the fixed proportion of values within a given number of SDs of the mean:

  • About 68.3 percent of values fall within ±1 SD of the mean.
  • About 95.4 percent fall within ±2 SD (exactly 95 percent within ±1.96 SD).
  • About 99.7 percent fall within ±3 SD.

These proportions explain why a single control result outside ±2 SD is not necessarily alarming: about 1 result in 22 will fall there by chance alone when nothing is wrong. A result outside ±3 SD is much rarer, about 3 in 1000, so it more strongly suggests a problem. Lesson 10 uses these probabilities to design control rules that catch real errors without too many false alarms.

Z-scores and standard deviation index

A z-score expresses how many SDs a value lies from the mean: z = (x − x̄) ÷ SD. A glucose control result of 5.57 mmol/L, with a mean of 5.25 and an SD of 0.16, has z = (5.57 − 5.25) ÷ 0.16 = 2.0. Z-scores allow results from different control levels or different tests to be plotted on a single chart, because every z-score has a mean of 0 and an SD of 1.

In external quality assessment and peer comparison programs, the same idea is called the standard deviation index (SDI): (laboratory result − peer group mean) ÷ peer group SD. An SDI of 0 means the laboratory agrees exactly with its peers; an SDI beyond ±2 suggests a possible bias that should be investigated.

Skewed distributions

Not all data are Gaussian. Many analytes in healthy people have skewed distributions with a long tail toward high values: triglycerides, enzyme activities and many hormones. In a right-skewed distribution, the mean is pulled toward the tail and lies above the median. Using mean ± 2 SD on skewed data produces a lower limit that may be below zero and an upper limit that is too low. Statisticians handle skewed data either with non-parametric methods, which use ranks and percentiles instead of mean and SD, or by transforming the data, most often by taking logarithms, which can make a right-skewed distribution approximately Gaussian.

Quality control data on a stable material are usually close to Gaussian, but not always. Data that include results from two reagent lots, two analyzers or a calibration shift can look wide or bimodal. A histogram of control results is a simple check that the data describe one stable process before limits are calculated.

Reference intervals

A reference interval describes the range of results expected in a defined healthy reference population, conventionally the central 95 percent, from the 2.5th to the 97.5th percentile. By definition, 5 percent of healthy people fall outside it, 2.5 percent on each side. A result outside the reference interval is therefore not automatically abnormal, and the more tests ordered on a healthy person, the more likely at least one will be flagged by chance.

Guidance from the Clinical and Laboratory Standards Institute (CLSI) recommends that a laboratory establishing its own reference interval use at least 120 carefully selected reference individuals per partition (for example, per sex or age group), and calculate the interval non-parametrically from their ranked results. Because that is expensive, most laboratories instead verify an interval supplied by a manufacturer or the literature, testing a smaller number of healthy individuals, commonly 20. If no more than 2 of the 20 results fall outside the proposed interval, the interval is accepted for that population.

In the United States, CLIA requires laboratories to verify that the manufacturer's reference intervals are appropriate for their patient population when introducing an unmodified FDA-cleared method (42 CFR 493.1253). Some laboratories adopt published pediatric intervals, such as those from the Canadian CALIPER project, after local verification.

Standard error and confidence intervals

The SD describes the spread of individual results. The standard error of the mean (SEM) describes how precisely the mean itself is known: SEM = SD ÷ √n. The more results you average, the smaller the SEM. For the ten glucose results, SEM = 0.158 ÷ √10 = 0.050 mmol/L.

A 95 percent confidence interval for the mean is approximately mean ± 2 × SEM (more exactly, ± 1.96 SEM for large samples, or using a t-value for small ones). For the glucose control, the interval is about 5.25 ± 0.10, or 5.15 to 5.35 mmol/L. It means that if the experiment were repeated many times, about 95 percent of such intervals would contain the true mean. Confidence intervals are used when judging whether a bias between two methods is real or could be due to chance, and when deciding how many control results are enough to establish a reliable mean.

Comparing groups: t-test and F-test

Two simple statistical tests appear in method verification. The t-test asks whether two means differ by more than chance would explain, for example whether a new reagent lot gives a different mean from the old one. A paired t-test is used when the same specimens are measured by both methods. The F-test compares two variances: the ratio of the larger variance to the smaller is compared with a critical value, to judge whether one method is less precise than another. Both tests depend on sample size; with very large samples, trivially small differences become "statistically significant", and with small samples, important differences can be missed. The laboratory's real question is always whether a difference is clinically significant, judged against defined quality goals, as Lesson 11 shows.

Sensitivity, specificity and predictive value

Statistics also describes how well a test separates people with and without a condition. Consider a test applied to people whose true status is known. Results fall into four groups: true positives (TP), false positives (FP), true negatives (TN) and false negatives (FN).

  • Sensitivity = TP ÷ (TP + FN): the proportion of people with the condition who test positive.
  • Specificity = TN ÷ (TN + FP): the proportion of people without the condition who test negative.
  • Positive predictive value (PPV) = TP ÷ (TP + FP): the probability that a person with a positive result has the condition.
  • Negative predictive value (NPV) = TN ÷ (TN + FN): the probability that a person with a negative result does not have the condition.

Worked problem

Predictive value depends on prevalence

A screening test has 95 percent sensitivity and 95 percent specificity. It is used in 1000 people in whom the condition has a prevalence of 2 percent. Calculate the PPV.

Show solution
  1. People with the condition: 2 percent of 1000 = 20. True positives = 95 percent of 20 = 19; false negatives = 1.
  2. People without the condition: 980. True negatives = 95 percent of 980 = 931; false positives = 49.
  3. PPV = TP ÷ (TP + FP) = 19 ÷ (19 + 49) = 19 ÷ 68 = 0.28.
  4. NPV = TN ÷ (TN + FN) = 931 ÷ 932 = 0.999.

Answer: Only about 28 percent of positive results are true positives, even though the test is 95 percent sensitive and specific, because the condition is uncommon. Predictive values change with prevalence; sensitivity and specificity do not.

Putting the numbers to work

Priyanka took Noor's hand-calculated SD and compared it with the value from the laboratory's QC software. They matched to the third decimal. "Good," she said. "Now you know the chart isn't magic. The limits are the mean plus or minus multiples of that number. Everything we do next, the rules, the charts, the investigations, starts here."

Common mistakes

  • MistakeDividing by n instead of n − 1 when calculating a sample SD.

    InsteadUse the sample SD (n − 1) for quality control and verification data, and check which formula your software uses.

  • MistakeComparing SDs of control levels with very different means.

    InsteadCompare CVs, which express imprecision relative to the mean.

  • MistakeTreating every result outside the reference interval as abnormal.

    InsteadRemember that 5 percent of healthy people fall outside a central 95 percent interval.

  • MistakeApplying mean ± 2 SD to strongly skewed data.

    InsteadUse non-parametric percentiles or transform the data before calculating limits.

  • MistakeCalculating control limits from data that mix two lots or two analyzers.

    InsteadCheck that the data describe one stable process, for example with a histogram, before setting limits.

  • MistakeAssuming a positive result from a highly specific test is almost certainly correct.

    InsteadPredictive value depends on prevalence; in low-prevalence settings, false positives can outnumber true positives.

Summary and key terms

  • Mean, median and mode describe the center of data; range, SD, variance and CV describe spread.
  • Sample SD = √[Σ(x − x̄)² ÷ (n − 1)]; CV = SD ÷ mean × 100.
  • In a Gaussian distribution, about 68.3, 95.4 and 99.7 percent of values fall within ±1, ±2 and ±3 SD.
  • A z-score or SDI gives the number of SDs a value lies from a mean.
  • Skewed data need non-parametric or transformed statistics.
  • Reference intervals cover the central 95 percent of a healthy population; verification commonly uses 20 individuals with no more than 2 outside.
  • SEM = SD ÷ √n describes the precision of a mean; t-tests compare means and F-tests compare variances.
  • Sensitivity and specificity are properties of the test; predictive values also depend on prevalence.
Mean
The sum of values divided by their number.
Median
The middle value of ordered data.
Standard deviation (SD)
A measure of the spread of values around the mean.
Coefficient of variation (CV)
The SD expressed as a percentage of the mean.
Gaussian distribution
A symmetrical bell-shaped distribution described by its mean and SD.
Z-score
The number of SDs a value lies from the mean.
Standard deviation index (SDI)
A laboratory's difference from its peer group mean divided by the peer group SD.
Reference interval
The range containing the central 95 percent of results from a healthy reference population.
Standard error of the mean
SD divided by the square root of n; the precision of a mean.
Positive predictive value
The probability that a person with a positive result has the condition.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Five results are 98, 102, 100, 101 and 99 U/L. What are the mean and SD?

    Show answer

    Mean 100; squared deviations 4, 4, 0, 1, 1 sum to 10; variance 10 ÷ 4 = 2.5; SD = 1.58 U/L.

  2. A control has a mean of 4.0 mmol/L and an SD of 0.12 mmol/L. What is its CV?

    Show answer

    0.12 ÷ 4.0 × 100 = 3.0 percent.

  3. Within what limits should about 95 percent of results fall for a control with mean 140 and SD 1.5 mmol/L?

    Show answer

    140 ± 3.0, from 137.0 to 143.0 mmol/L.

  4. A laboratory's result is 6.4, the peer mean is 6.0 and the peer SD is 0.2. What is the SDI?

    Show answer

    (6.4 − 6.0) ÷ 0.2 = 2.0.

  5. A test has 90 percent sensitivity and 80 percent specificity in 200 people, 100 with the condition. What is the PPV?

    Show answer

    TP = 90, FP = 20; PPV = 90 ÷ 110 = 0.82.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz