Skip to content
Pass Duke Elder
Textbook / Chapter 16 / Statistics, epidemiology and public health

Basic statistics

The exam allows no calculator, so its statistics questions test understanding and simple arithmetic. This lesson covers the types of data, how to summarise them, what a p value and a confidence interval mean, which test fits which data, and the measures of risk, each with worked examples in easy numbers.

8 minute read6 linked questions

Types of data

The type of data decides how it is summarised and tested, so classify it first. Categorical data put people into groups. Quantitative data are numbers that measure or count.

TypeMeaningEye example
NominalCategories with no order. Two categories is called binaryEye colour, glaucoma present or absent
OrdinalCategories with an order but unequal stepsDiabetic retinopathy grade, Snellen line
DiscreteWhole number countsNumber of intravitreal injections
ContinuousMeasured on a scale, any value possibleIntraocular pressure, axial length
Types of data

Averages and spread

The mean is the sum of the values divided by their number. The median is the middle value when they are ranked. The mode is the most frequent value. Take five intraocular pressures: 12, 14, 16, 18 and 40 mmHg. They sum to 100, so the mean is 20. The median is the third value, 16. The single reading of 40 has pulled the mean up but left the median alone.

That is the rule for choosing between them. An extreme value is an outlier, and a distribution with a long tail on one side is skewed. A tail of high values is positive skew and drags the mean above the median. A tail of low values is negative skew. For skewed data report the median with the interquartile range (the 25th to 75th centiles). For symmetrical data report the mean with the standard deviation (SD), which describes how far individual values typically lie from the mean. The variance is the SD squared.

Many biological measurements follow the normal distribution: a symmetrical bell curve in which mean, median and mode coincide. About 68% of values lie within 1 SD of the mean, about 95% within 2 SD (1.96 to be exact) and over 99% within 3 SD. If a population has a mean pressure of 16 mmHg and an SD of 3, about 95% of people lie between 10 and 22.

Standard error and confidence intervals

A study measures a sample to estimate the truth about a population. A different sample would give a slightly different mean. The standard error (SE) measures how much the sample mean would vary between samples, so it describes the precision of the estimate. The SD describes the scatter of individuals. The SE is always smaller and shrinks as the sample grows.

SE = SD / √nn is the sample size. Quadrupling the sample halves the SE.
95% confidence interval = mean ± 1.96 × SEUse 2 instead of 1.96 for mental arithmetic.

Worked example 1: 100 patients have a mean pressure of 16 mmHg with SD 3. The square root of 100 is 10, so SE = 3 / 10 = 0.3. The 95% confidence interval is 16 ± 0.6, which is 15.4 to 16.6. Worked example 2: 25 patients read a mean of 60 letters with SD 10. The square root of 25 is 5, so SE = 10 / 5 = 2 and the interval is 60 ± 4, which is 56 to 64.

A 95% confidence interval is the range within which we can be 95% confident that the true population value lies. Strictly, if the study were repeated many times, 95% of the intervals calculated this way would contain the true value. A narrow interval means a precise estimate. It also works as a significance test. If the interval for a difference between groups includes 0, or the interval for a ratio such as relative risk includes 1, the result is not significant at the 5% level.

Hypothesis tests, p values and errors

A significance test starts from the null hypothesis: that there is no difference between the groups. The p value is the probability of seeing a difference at least as large as the one observed if the null hypothesis were true. A small p value means the data would be surprising under the null, so the null is rejected. By convention the threshold, called alpha, is 0.05.

A p value is not the probability that the null hypothesis is true, and it says nothing about the size of an effect. A huge trial can find a statistically significant difference of one letter of acuity that no patient would notice. Statistical significance and clinical importance are separate judgements. A p value above 0.05 does not prove there is no effect either: the study may have been too small.

Type I errorType II error
What happensThe null is rejected when it is trueThe null is accepted when it is false
In plain wordsA false positive: an effect is claimed that is not realA false negative: a real effect is missed
ProbabilityAlpha, usually set at 0.05Beta, usually set at 0.20
Made more likely byTesting many outcomes, a lenient thresholdA small sample, a small effect, variable data
The two errors of a significance test

Power is the probability that a study detects an effect that really exists. It equals 1 minus beta, so the usual beta of 0.20 gives 80% power. Power rises with a larger sample, a larger true effect and less variable data. A sample size calculation done before a trial chooses the number of patients needed to reach the planned power.

Choosing a test

Parametric tests assume the data are continuous and roughly normally distributed, and they compare means. Non-parametric tests make no such assumption. They work on the ranks of the values, so they suit skewed data, ordinal data and small samples, at the cost of somewhat less power. The other question is whether the groups are independent (different people) or paired (the same people measured twice).

ComparisonParametricNon-parametric
Two independent groupsUnpaired t-testMann-Whitney U test
Two paired measurementsPaired t-testWilcoxon signed-rank test
Three or more independent groupsOne-way ANOVAKruskal-Wallis test
Three or more repeated measurementsRepeated measures ANOVAFriedman test
Which test for which comparison

Categorical data are compared as proportions in a table of counts. The chi-squared test does this for independent groups, and Fisher's exact test replaces it when numbers are small. McNemar's test is the version for paired proportions.

Measuring risk

Risk is the number of people with an event divided by everyone in the group. Odds are the number with the event divided by the number without. Trials and cohort studies compare risks. Case-control studies cannot calculate risk, because the researcher fixed the number of cases, so they compare odds.

Relative risk (RR) = risk in treated / risk in controlRelative risk reduction = 1 − RR.
Absolute risk reduction (ARR) = risk in control − risk in treated; NNT = 1 / ARRWith ARR as a percentage, NNT = 100 / ARR. Round up to a whole person.

Worked example 1: in a trial 20 of 100 control patients and 10 of 100 treated patients lose vision. The risks are 20% and 10%. RR = 10 / 20 = 0.5, a relative risk reduction of 50%. ARR = 20 − 10 = 10%. The number needed to treat (NNT) is 100 / 10 = 10: ten patients must be treated to prevent one event. Worked example 2 uses the Ocular Hypertension Treatment Study, where glaucoma developed in 9.5% under observation and 4.4% on drops over five years. ARR = 9.5 − 4.4 = 5.1%, about 5%, so NNT = 100 / 5 = 20.

Relative measures hide the baseline. Halving a risk of 20% saves 10 people per 100 (NNT 10). Halving a risk of 2% saves 1 per 100 (NNT 100). The relative risk reduction is 50% in both. An RR of 1 means no difference, below 1 means fewer events with treatment and above 1 means more.

Odds ratio (OR) = (a × d) / (b × c)a = exposed cases, b = exposed controls, c = unexposed cases, d = unexposed controls.

Worked example 3: of 100 cases, 50 were exposed and 50 were not. Of 100 controls, 20 were exposed and 80 were not. OR = (50 × 80) / (20 × 50) = 4000 / 1000 = 4. The odds of exposure are four times higher in cases. When the disease is rare, the odds ratio is close to the relative risk.

Incidence and prevalence

Incidence counts new cases arising in a population at risk over a period of time. Prevalence is the proportion of a population who have the condition at one moment. Incidence measures the rate of becoming ill and is used to study causes. Prevalence measures the existing burden and is used to plan services.

Prevalence ≈ incidence × average durationHolds for a stable population when the disease is uncommon.

Worked example: a disease has an incidence of 2 new cases per 1,000 people each year and lasts an average of 10 years. Prevalence is about 2 × 10 = 20 per 1,000, or 2%. This explains why chronic diseases such as glaucoma have a high prevalence relative to their incidence, while a short illness such as viral conjunctivitis has the reverse. A treatment that keeps people alive with a disease without curing it raises prevalence while incidence stays the same.

Summary

  • Data are nominal, ordinal, discrete or continuous, and the type decides the summary and the test.
  • Use the mean and standard deviation for symmetrical data and the median and interquartile range for skewed data.
  • In a normal distribution about 68% of values lie within 1 SD, 95% within 2 SD and over 99% within 3 SD of the mean.
  • Standard error equals SD divided by the square root of n, and the 95% confidence interval is the mean plus or minus 1.96 standard errors.
  • The p value is the probability of a result at least this extreme if the null hypothesis is true.
  • A type I error is a false positive with probability alpha, and a type II error is a false negative with probability beta.
  • Power equals 1 minus beta and rises with sample size and effect size.
  • Parametric tests such as the t-test compare means of normal data, and non-parametric tests such as Mann-Whitney U compare ranks.
  • Number needed to treat is 1 divided by the absolute risk reduction.
  • Prevalence is approximately incidence multiplied by duration.

Check yourself

Quick recall on this lesson. These are easier than the question bank.

1. Five patients have pressures of 12, 14, 16, 18 and 40 mmHg. What is the median?
2. An event occurs in 20% of control patients and 15% of treated patients. What is the number needed to treat?
3. A trial concludes that a drug has no effect when in truth it works. Which error is this?
4. Which test compares a skewed continuous outcome between two independent groups?
Practise 6 questions on this lesson

Written for revision. It is not a source of clinical advice, and guidance changes.