Worked example
Classifying four variables from one handover sheet. A nurse is asked to prepare a small audit from the morning handover. Every patient has four characteristics recorded: blood group (A, B, AB or O), temperature in °C, number of hospital admissions in the past 12 months, and blood glucose in mmol/L. Before any calculation, she classifies each one and states the reason.
- Blood group. The recorded value is a label — A, B, AB or O — and it carries no unit. First question answered as “label”, so blood group is qualitative.
- Temperature. The value is a number, so ask the second question. A reading of 38.4 °C could have been 38.37 °C or 38.42 °C and the thermometer simply rounds it, so the value can be split. Temperature is quantitative continuous.
- Number of admissions. This is also a number, but it counts separate events. One admission either happened or it did not, so the possible values are 0, 1, 2, 3 and nothing between them. Number of admissions is quantitative discrete.
- Blood glucose. A value of 7.8 mmol/L is read from a measuring instrument on a graduated scale, and the true value could lie between 7.75 and 7.85 mmol/L. Blood glucose is quantitative continuous.
- Check the pattern. The first question separated labels from numbers and caught blood group; the second question separated counts of events from measured quantities and caught admissions. Two questions, four variables, one consistent answer each.
The audit may now count patients per blood group and compute percentages, total and average admissions, and describe temperatures and glucose readings by their differences and averages. None of those operations was safe until the four types had been named.
Tutorial 1 — classifying eight ward variables, with one that only looks discrete
A nurse is setting up a small ward register. Eight characteristics will be recorded for every patient: blood group; sex; type of disease; number of hospital admissions in the past year; number of tablets taken daily; body temperature in °C; blood glucose in mmol/L; body weight in kg. Classify all eight, and pay special attention to a temperature written as 37.0 °C.
Rule used: Decision rule, applied in order. A value that names a category and carries no unit is qualitative. A value that is a number is quantitative: if it counts separate events or objects, it is discrete and only whole values are possible (admissions, tablets); if it is read from a measuring instrument on a scale, it is continuous and any value in the interval is possible (kg, °C, mmol/L).
Look at the eight characteristics. Which ones name a category and carry no unit at all?
Reveal the answer
Blood group, sex and type of disease. None of the three has a unit — there is no “kg of blood group” — and each simply places the patient in one of several categories, so all three are qualitative.
Write the qualitative variables in one column and, beside each, list two or three possible categories.
Reveal this step
Blood group: A, B, AB, O. Sex: female, male. Type of disease: malaria, pneumonia, diabetes, for example. Writing the categories out is what proves the entry is a label rather than an amount.
Now take the number of hospital admissions and the number of tablets taken daily, and classify both. State what each number is counting.
Reveal this step
Both are quantitative discrete. Admissions counts separate hospital events; tablets counts separate objects. Each count moves in whole steps — 0, 1, 2, 3 — and there is no value between one step and the next, which is exactly what “discrete” means.
One patient’s temperature is written as 37.0 °C — a whole number with no decimals. Does that make temperature a discrete variable? Explain.
Reveal the answer
No. Discrete and continuous describe the values that are possible, not the digits that were written. A thermometer reads to the nearest tenth, so the true temperature might be 36.98 °C or 37.04 °C; it merely happened to land on 37.0. Temperature comes from measurement, not from counting, so it stays continuous.
Classify the remaining three: temperature, blood glucose and body weight. Give the unit of each and the reason for the type.
Reveal this step
All three are quantitative continuous. Their units are °C, mmol/L and kg. Each is read from an instrument on a graduated scale, and between any two possible readings a further reading always exists: a weight of 64 kg could be 63.8 kg or 64.15 kg.
Which single test separates “number of admissions” from “temperature”, given that both are written as numbers?
Reveal the answer
Ask where the number came from. Admissions arose from tallying separate events, so only whole values exist and the variable is discrete. Temperature arose from reading a scale, so any value in the interval exists and the variable is continuous. Counting gives whole steps; measuring gives a smooth scale.
Answer: Eight variables classified: blood group, sex and type of disease qualitative; number of admissions and number of tablets discrete quantitative; temperature, blood glucose and body weight continuous quantitative.
Keep this habit: Run the two questions in order and never skip the first. A whole number on the page does not make a variable discrete; what matters is whether the value was counted from separate events or measured on a scale. If you cannot name the unit, you are almost certainly looking at a label.
Tutorial 2 — why the digits in a blood group code are labels, not measurements
A ward database stores blood group as a code: 1 = A, 2 = B, 3 = AB and 4 = O. A junior colleague exports a list, sees the digits, calculates a mean of 2.5 and writes in the report that the ward’s “average blood group is 2.5”. Another colleague reads the same code and claims that group O patients have four times as much of something as group A patients. Both readings are wrong, and this tutorial shows exactly why.
Rule used: A number is a measurement only when the arithmetic done on it matches a real quantity. Before adding, subtracting or averaging any value, name its unit. A category has no unit, so its code may be counted and expressed as a frequency or a percentage, but it may never be added, subtracted or averaged.
The code for group B is 2. What unit does that 2 carry, and what does it actually tell you?
Reveal the answer
It carries no unit at all. The 2 is a shorthand name for the category “B”, chosen only because the database needs a short entry. It tells you which category the patient belongs to and nothing about an amount, so it is a label written in digits.
Write down the summary that this variable does allow. Suppose 20 patients are coded, and the counts are 7, 5, 3 and 5 for codes 1, 2, 3 and 4.
Reveal this step
Count each category and give its frequency. Group A: 7 of 20 = 35 %. Group B: 5 of 20 = 25 %. Group AB: 3 of 20 = 15 %. Group O: 5 of 20 = 25 %. The four percentages add to 100 %, which confirms the count is complete.
The colleague averages the codes and reports “average blood group 2.5”. State the error precisely rather than saying only that it is wrong.
Reveal the answer
Averaging requires values that sit on a real scale with equal steps, so that a mean corresponds to an actual amount. Blood group codes have no such scale, and 2.5 corresponds to no category: it is neither A, nor B, nor AB, nor O. The calculation is arithmetically correct and statistically meaningless.
Rewrite the sentence in the report so that it says something true about the ward.
Reveal this step
Replace it with a count or a proportion, for example: “Of the 20 patients coded, 7 (35 %) are group A, 5 (25 %) group B, 3 (15 %) group AB and 5 (25 %) group O.” A frequency statement reports what the label can support.
The second colleague says group O patients have “four times more” than group A patients, because O is coded 4 and A is coded 1. What test exposes this as nonsense?
Reveal the answer
Ask what is being compared and in what unit. Four times more of what — four times more blood, more red cells, more of a substance? No quantity was measured, and the codes are arbitrary names: the same ward could code O as 1 and A as 4 and every patient would be unchanged. A label has no magnitude to compare.
Answer: The correct summary is a frequency table: group A 7 of 20 (35 %), group B 5 (25 %), group AB 3 (15 %), group O 5 (25 %). The reported mean of 2.5 is withdrawn, because no category has that value.
Keep this habit: Digits in a database are not evidence of a measurement. Before you average anything, ask what the number counts or measures and name its unit; if there is no unit, count the categories instead. This one check prevents the most common statistical error a beginner makes with coded clinical data.
Now you try
Attempt each one on paper first. Write the formula, substitute the numbers, then check the unit of your answer.
A nurse records four values for one patient: blood group AB; height 1.62 m; number of children 2; pain described as “moderate”. Classify each of the four and give the reason for each choice.
Hint
Run the two questions in order for every value, and remember that “moderate” is an opinion described in words, not a number read from an instrument.
Show the worked answer
Blood group AB is qualitative: it names a category and has no unit. Height 1.62 m is quantitative continuous: it is measured on a scale and could have been 1.615 m. Number of children 2 is quantitative discrete: children are counted as separate individuals. “Moderate” pain is qualitative: it places the patient in a described category rather than giving a measured amount.
A ward records “number of hospital admissions in the past 12 months” and “length of stay in days”. Classify both, and state which one would change if a patient stayed 3.5 days.
Hint
One of the two counts whole events; the other is a duration. Ask what happens to the possible values if the unit is made smaller — days can become hours.
Show the worked answer
The number of admissions is quantitative discrete: each admission is a separate event and cannot be split. Length of stay is quantitative continuous: it is a measured duration, and a stay of 3.5 days is perfectly possible, as is 3.52 days. It is the length of stay that changes when a patient stays 3.5 days; the number of admissions would remain a whole number, here 1.
A database stores smoking status as 0 = non-smoker, 1 = former smoker, 2 = current smoker. A colleague sums the column and reports “total smoking score 84”. Explain what is wrong and give the summary that should replace it.
Hint
Ask whether the three codes sit on a real scale with equal steps. Then ask which summary a category does support.
Show the worked answer
Smoking status is qualitative, so the codes are labels and carry no unit. A total of 84 corresponds to no group of patients and cannot be interpreted, even though the addition is arithmetically correct. The lawful summary is a frequency count with percentages: for example, “of 42 patients, 18 (43 %) are non-smokers, 11 (26 %) former smokers and 13 (31 %) current smokers”. The counts should add to the number of patients, and the percentages to 100 %.
A nurse says: “The patient’s temperature is 39.0 °C, so temperature must be a discrete variable, because there are no decimals.” Reply to the nurse in two or three sentences, using one other variable as evidence.
Hint
Discrete and continuous are about the values that are possible, not about the digits that were written down. Compare with a weight of exactly 70 kg.
Show the worked answer
The absence of a decimal point says nothing about the type. A thermometer reads to the nearest tenth, so a true temperature of 38.96 °C would also be written 39.0 °C, and the variable is continuous because any value in the interval is possible. Body weight behaves the same way: a patient written as exactly 70 kg could weigh 70.04 kg, and nobody would call weight discrete on the strength of a round number. What makes a variable discrete is counting separate events, as with the number of admissions.
Common misconception
The commonest wrong model is “if it is written as a number, it is quantitative”. Beginners meet a database column full of digits — blood group coded 1 to 4, sex coded 1 and 2 — and conclude that the variable must be numerical, so it can be averaged. The test is not what the value looks like but what it means. A number that names a category carries no unit and supports no arithmetic beyond counting; a number that reports an amount carries a unit and supports addition. When a ward report offers you an “average blood group”, the right response is to ask what unit that average is in — the answer exposes the error immediately.
Check your reasoning
A colleague claims: “Any variable stored as a number in a computer is quantitative.” Using one variable you record every shift and one that is stored as text, show why the storage format is the wrong test, and state the test you would use instead.
Reveal an answer
Storage format describes the computer, not the patient. Blood group is routinely stored as the integers 1 to 4, yet it is qualitative, because the values name categories and have no unit. Conversely, a ward that stores every entry as text may hold “38.4” for temperature, which is quantitative continuous, because the value reports a measured amount in °C. The reliable test is meaning: ask whether the value names a category or reports a quantity, and if it reports a quantity, ask whether that quantity was counted in whole events or measured on a scale. That test travels with the data, whereas the format changes with whatever software the hospital happens to use.
Where this comes from
- BMS 1110 Applied Mathematics and Medical Biostatistics lecture notes (supplied) · Chapter One “Variables and Types of Data”, lines 522–590: meaning of a variable and the nine recorded characteristics (522–535); the five-patient table with age, sex, weight and blood pressure (536–545); qualitative and quantitative variables with their examples, including the warning that categories may be represented by numbers in a database but those numbers are labels rather than measurements (546–567); discrete variables, the 0, 1, 2, 3, 4 … children example and the 2.6 child remark (568–578); continuous variables, the weight series 60 kg, 60.2 kg, 60.25 kg, 60.253 kg and the phrase “depending on the precision of the measuring instrument” (579–590).
- Note on the course code · The supplied cover page reads “Course Number: BMS 110”. The curriculum catalogue in this project records “BMS 1110”; the catalogue is treated as authoritative and the notes’ cover value is retained here for provenance.
- Beyond the supplied notes: counting versus measuring, instrument resolution and the consequences of misclassification · The countable-event test for a discrete variable, measurement resolution and rounding (the thermometer interval behind 38.4 °C, the glucometer reading in tenths of mmol/L, the scale marked in 0.5 kg), and the downstream effect of a misclassified variable on summaries, displays and audits are standard biostatistics that the notes list but do not explain.