Learning outcomes
By the end of this lesson you should be able to: present health data as tables and graphs and choose the right graph for the data type; compute and interpret the mean, median and mode and the range, standard deviation, quartiles and coefficient of variation on a worked dataset; use the properties of the normal distribution to find the proportion of a population within given limits; describe the methods of sampling and the difference between sampling and non-sampling error; explain the null hypothesis, the p-value and the two types of statistical error; and read the tests of significance, correlation and regression that the journals put in front of you.
Prerequisites
None formally — arithmetic is sufficient for this lesson — but Lesson 4 (environmental health) supplies the kind of data this analysis is used on, and Lesson 6 (epidemiological methods) uses the measures developed here.
The big idea
Statistics exists because every measurement is imperfect and no sample is the population. You measure the haemoglobin of 200 women, treat 100 anaemic patients and vaccinate 100 others, and a month later the treated group is better: is the vaccine working or did you simply pick the luckier 100? Biostatistics is the discipline that quantifies that uncertainty, and the two questions it answers are 'what is the true value of this measurement' (measurement and estimation) and 'could this difference be a coincidence' (testing). Every one of its methods is a way of putting a number on the word 'probably'.
Types of data
| Type of data | Definition | Examples in medicine | Summary and analysis |
|---|---|---|---|
| Qualitative (categorical) | Individuals are placed in categories, not measured | Sex, blood group, disease present or absent, cured or not | Proportions; chi-square test; tabulation |
| Quantitative — discrete | Whole-number counts | Number of children, deaths per week, children per family | Mean, median; Poisson methods; rates |
| Quantitative — continuous | A value on a scale that can take any intermediate value | Height, weight, haemoglobin, blood pressure | Mean, standard deviation; t-tests, correlation |
Presenting data
Data must be seen before it is interpreted. A frequency distribution lists every class of values with its count; a histogram draws the frequencies of continuous data as adjacent bars over the class limits; a bar chart is for categorical counts; a pie chart shows the components of a single total; a line chart shows a trend over time; a frequency polygon and its cumulative partner, the ogive, sit over the histogram. For small datasets a stem-and-leaf display keeps the actual values while showing the shape.
NoteThe shape of a distribution decides which summary to quote. A symmetrical dataset is described by the mean and the standard deviation; a skewed dataset — income, hospital stay, incubation period — is described by the median and the quartiles, because the mean is dragged toward the tail and no longer describes the typical value.
Measures of central tendency — a worked example
Weights (kg) of 10 children at a growth monitoring session: 10, 11, 12, 12, 13, 14, 14, 15, 16, 17. Sum = 134 kg, so the mean is 134/10 = 13.4 kg. Arranged in order, the 5th and 6th values are 13 and 14, so the median is (13 + 14)/2 = 13.5 kg. The values 12 and 14 each occur twice, so the distribution is bimodal with modes 12 and 14 kg. Note the mean is pulled slightly right of the median, as expected in a mildly right-skewed set.
| Child | Weight (kg) | Deviation from the mean (kg) | Squared deviation |
|---|---|---|---|
| 1 | 10 | -3.40 | 11.56 |
| 2 | 11 | -2.40 | 5.76 |
| 3 | 12 | -1.40 | 1.96 |
| 4 | 12 | -1.40 | 1.96 |
| 5 | 13 | -0.40 | 0.16 |
| 6 | 14 | 0.60 | 0.36 |
| 7 | 14 | 0.60 | 0.36 |
| 8 | 15 | 1.60 | 2.56 |
| 9 | 16 | 2.60 | 6.76 |
| 10 | 17 | 3.60 | 12.96 |
| Total | 134 | 0.00 | 44.40 |
The last column is the key to the whole lesson: the deviations cancel out (they sum to zero), but the squared deviations add to 44.40 kg squared. Dividing by n-1 = 9 gives the sample variance of 4.93 kg squared, and taking the square root gives a standard deviation of 2.21 kg. The n-1, not n, is deliberate: it corrects the bias of estimating the population spread from a sample, and it is why a sample standard deviation is described as unbiased.
| Statistic | Value from the 10 weights |
|---|---|
| Mean | 13.4 kg |
| Median | 13.5 kg |
| Mode | 12 kg and 14 kg (bimodal) |
| Range (max - min) | 17 - 10 = 7 kg |
| First quartile Q1 (middle of the lower half) | 12 kg |
| Third quartile Q3 (middle of the upper half) | 15 kg |
| Interquartile range (Q3 - Q1) | 3 kg |
| Sample standard deviation | 2.21 kg |
| Coefficient of variation (SD/mean x 100) | 2.21/13.4 = 16.5% |
NoteThe coefficient of variation lets you compare the variability of two different measurements — 16.5% of variation in these weights against 8% of variation in their heights says the weights are comparatively more scattered. A range of 7 kg and an IQR of 3 kg together show that the spread is gentle rather than extreme.
The normal distribution
Histograms of biological measurements cluster in the middle and thin toward both tails in a bell shape, and the closer the data follow that shape, the more precisely a standard deviation lets you speak. In a perfectly normal distribution, mean = median = mode, and fixed proportions lie within fixed multiples of the standard deviation. Applied to the weights above (mean 13.4, SD 2.21), those limits become concrete.
| Limits (mean plus/minus SD) | Range for the ten children (kg) | Proportion of a normal population within |
|---|---|---|
| Mean +/- 1 SD (13.4 +/- 2.21) | 11.2 to 15.6 | 68.3% |
| Mean +/- 2 SD (13.4 +/- 4.42) | 9.0 to 17.8 | 95.4% |
| Mean +/- 3 SD (13.4 +/- 6.63) | 6.8 to 20.0 | 99.7% |
The working convention that follows is a 95% reference interval, mean +/- 2 SD: a child outside it is unusual (the lowest 2.5% or the highest 2.5%) and warrants a second look. This is the same logic behind the reference ranges printed on laboratory reports, and it is why growth charts are built on the standard deviation, not on a fixed cut-off.
Probability and sampling
| Sampling method | How it works | When it is used | Chief risk |
|---|---|---|---|
| Simple random | Every individual has an equal chance (lottery or random numbers) | A small, listed population | Impractical for a large population without a list |
| Systematic | Every k-th person from a starting point | Large ordered lists, records | Bias if the list has a hidden periodicity |
| Stratified | The population is divided into strata, then randomly sampled within each | Groups that must be represented (sex, urban and rural) | Wrong strata weights if sampling fractions differ |
| Cluster (multistage) | Groups (villages, schools) are sampled, then persons within them | Wide-area surveys that must be affordable | Clustered people are alike, so the effective sample is smaller than it looks |
| Volunteer and convenience | Whoever is available | Not for prevalence estimation | Selection bias — the people who came are not the population |
NoteSampling error is the difference between a sample's result and the population's truth — it is inevitable, it shrinks as the square root of the sample size, and it is quantified by the confidence interval. Non-sampling error — selection bias, misclassification, non-response, a miscalibrated instrument — is not reduced by a larger sample and it biases the result in direction. A biased 10,000-person survey is more dangerous than a biased 100-person one, because it reports the same wrong answer with a tighter interval.
Testing: the null hypothesis and the p-value
| Term | Meaning | Clinical example |
|---|---|---|
| Type I error (alpha) | Rejecting a true H0 — a false positive | Declaring an ineffective drug useful |
| Type II error (beta) | Failing to reject a false H0 — a false negative | Missing a genuinely effective drug |
| Power (1 - beta) | The chance of detecting a real effect, usually set at 80% or more | The sample size calculation that justifies a trial |
| 95% confidence interval | The range that would contain the true value in 95% of repeats | 'Risk ratio 4.0 (95% CI 2.1-7.6)' — the interval excludes 1, so the association is real |
| Situation | Appropriate test |
|---|---|
| Compare two independent means (e.g. mean BP in two groups) | Unpaired t-test |
| Compare means of 3 or more groups | Analysis of variance (ANOVA) |
| Compare paired means (before and after in the same patients) | Paired t-test |
| Compare proportions between groups (2x2 tables) | Chi-square test |
| Small samples or non-normal data, compare medians | Mann-Whitney or Wilcoxon test |
| Association between two continuous variables | Pearson correlation coefficient, regression |
Correlation and regression
Correlation coefficient r measures the strength and direction of a linear association between -1 and +1: r of +0.9 is a strong positive association, r of 0 is none, r of -0.7 a strong negative one. Regression goes one step further and predicts the value of one variable from another, which is how a growth chart predicts a child's weight from age. The rule that keeps both honest: correlation is not causation — an r of 0.9 between ice-cream sales and drowning deaths is a third variable, the summer.
Common mistakes
Watch outQuoting the mean for skewed data. Income, hospital stay and incubation period have long tails; a mean shifted by a few extreme values is not 'the average patient'. Use the median and the interquartile range whenever a histogram is skewed, and say so.
Watch outTreating p = 0.05 as a truth switch. P below 0.05 means the observed difference is unlikely under the null; it says nothing about the size of the effect or whether it matters clinically. Report the effect size with its confidence interval, not the p-value alone.
Watch outDividing by n instead of n-1 when estimating a population standard deviation from a sample. The n-1 correction (Bessel's correction) is what makes the estimate unbiased, and skipping it systematically underestimates the true spread — an error that compounds into every interval that follows.
Check your understanding
From the worked dataset, compute the sample standard deviation step by step.
In a survey of household incomes in a slum, three households earn ten times the rest. Which average describes the typical household best, and why?
A study reports a risk ratio of 3.0 with a 95% confidence interval of 1.2 to 4.8. What does this tell you?
Multiple choice
From the ten weights above, what is the median?
A new drug is declared better than the old one although the trial found no real difference. This error is best called:
Which measure of central tendency is the only one appropriate for categorical data such as the commonest diagnosis in a clinic?