← Common Core coursesBMS 1110 · Applied Mathematics and Medical Biostatistics
BMS 1110 · Common Core (Tronc commun)Section 4.1 · Organising and describing data
Section 17 of 30

Variables and types of data

Decide whether a recorded patient characteristic is qualitative or quantitative, and if it is quantitative whether it is discrete or continuous, then say why in one sentence.

New to this course? How each section works
  1. Learn gives you one short idea at a time. Each idea starts with a single sentence, then explains it, gives an example, and asks you a small question you can answer straight away.
  2. Explore shows a diagram of the same ideas. Click the numbered parts to read what each one is.
  3. Check asks a few questions. Answer them all correctly to finish the section and unlock the next one.
  4. “Go deeper” is optional. It adds mechanism and extra detail for when you are ready — nothing you need for the checks is hidden there.
Why this matters

Every figure on a ward is a value of some variable, and the type of that variable decides what you are allowed to do with it. You may count how many patients belong to blood group O and report that as a percentage; you may not add the letters together or average the codes a computer happens to use. You may add up admissions, and you may measure the fall in a temperature. Nurses who skip this step produce summaries that look precise and mean nothing — an “average” blood group, a “total” of two temperatures. The single habit of asking “is this a label or a number, and can the number be split?” protects every later calculation you will do in this unit.

What you need to know first

You need no statistics at all to start. You only need to be able to say what a value means: does it name a category, or does it give an amount? Rusty arithmetic is not a barrier here, because this section asks you to classify before you calculate anything.

Words to know (5)
Variable
A characteristic or attribute of a patient, object or population that can take different values. If it cannot differ, it is a constant, not a variable. Age is a variable because five patients in the same ward may be 20, 35, 28, 45 and 31 years old.
Qualitative variable
A variable whose values describe categories or characteristics rather than numerical quantities. Its values are labels, so it carries no unit. Blood group has the categories A, B, AB and O. Sex, marital status, type of disease and smoking status are also qualitative.
Quantitative variable
A variable expressed numerically that represents a quantity which can be measured or counted. Its values are amounts, and an amount has a unit. Age, weight, height, heart rate, blood pressure, number of children and number of hospital admissions are all quantitative.
Discrete variable
A quantitative variable that takes distinct, countable values, usually whole numbers. It arises from counting separate events or objects, so there is nothing between two neighbouring values. The number of children in a family may be 0, 1, 2, 3, 4 … A patient cannot normally have 2.6 children.
Continuous variable
A quantitative variable that can take any value within a given interval. However precisely it is written down, a further value always lies between any two readings. A patient’s weight could be recorded as 60 kg, 60.2 kg, 60.25 kg or 60.253 kg depending on the precision of the instrument.
One idea at a timeIdea 1 / 5

In one sentence A variable is any characteristic of a patient that can take different values, which is why nearly every line of a chart is one.

A variable is a characteristic whose value changes from one patient to the next

A variable is a characteristic or attribute of an individual, patient, object or population that can take different values. The word is doing real work: a characteristic becomes a variable only when it is allowed to differ. In a study of one hundred patients, researchers may record age, sex, body weight, height, blood pressure, blood group, temperature, diagnosis and number of hospital visits. Each of these is a variable because its value may differ from one individual to another — no two patients need share a value. A constant, by contrast, is fixed for everyone in the study: the number of patients enrolled, 100, is a constant rather than a variable, because every row of the table shares it. Settling this distinction first is not pedantry. The whole of statistics is a body of rules for summarising values that vary, and those rules change according to what kind of variation you are looking at.

For example

In a five-patient table, age reads 20, 35, 28, 45 and 31 years. The values differ, so age is a variable; it would be a constant only if every patient happened to be the same age.

Pause and check yourself

A ward study enrols 100 patients and records each patient’s weight. Is the enrolled number 100 a variable, and is weight a variable?

Show the answer

Weight is a variable, because it can differ from patient to patient. The number 100 is a constant: it is fixed for every patient in the study and does not vary from row to row. A characteristic is only a variable when it is free to change.

Read detailed explanations
Counting is not measuring: what the whole-number rule really says

A discrete variable is not defined by the fact that its recorded values happen to look like whole numbers. It is defined by the way the quantity arises: it is produced by tallying separate, indivisible occurrences or objects. Admissions, tablets and infections all arise from counting events, so the only admissible answers form a list of isolated steps — 0, 1, 2, 3 — with nothing whatever in between. There can be no such thing as half an admission, because the event either occurred or it did not; the constraint belongs to the phenomenon, not to the pen. A continuous variable arises instead from an act of measurement, and measurement always compares a quantity against the subdivisions of a chosen instrument. Between any two readings there lies a further possible reading, however fine the subdivision becomes, which is why weight, height, temperature and glucose remain continuous even when a particular entry carries no decimal point. The practical test is therefore not what the paper displays but what the number tallies: ask whether the entry was produced by tallying distinct occurrences or by reading a graduated scale. The distinction has consequences when a learner mishandles it. A count cannot be halved and still describe anything, yet totals of counts may be added across patients and divided by the number of patients; the resulting 2.4 admissions per patient is a legitimate average even though no individual had 2.4 admissions. A measured quantity behaves differently: differences between its readings are themselves meaningful, so a drop from 39.2 °C to 37.9 °C is a 1.3 °C fall on any ward. Mixing the two — averaging a count as though it were a smooth measurement, or treating a measured value as a tally of events — yields summaries that no longer describe any real patient.

Measurement resolution: why a rounded reading stays continuous

Every instrument has a resolution, the smallest change it can display, and that limit explains why clinical values are written with a fixed number of decimals. A glass thermometer calibrated in tenths reports 38.4 °C, but the liquid in its column occupies a band rather than a mathematical point, so the reading stands for an interval — roughly 38.35 °C to 38.45 °C. A capillary glucometer working in tenths of mmol/L behaves the same way, and a weighing scale marked in 0.5 kg states an interval whenever it displays 70 kg. Resolution is not the same as accuracy: a device may be fine-grained and still misread, and a well-calibrated device may be coarse. What matters for classification is that the underlying quantity is capable of intermediate values; the display merely truncates them. This is why rounding a value never changes its type. Temperature displayed as 39.0 °C, glucose displayed as 6 mmol/L and weight displayed as 70 kg are all continuous, because each could have taken neighbouring values that the instrument chose not to show. Precision matters for a different reason: it limits what a difference can mean. Two temperatures of 37.1 °C and 37.2 °C differ by one gradation, which is within the uncertainty of a tenth-reading thermometer, so a nurse should not report a definite rise on that evidence alone. Recording a value with more decimals than the instrument supports is equally misleading — 7.82 mmol/L implies a resolution the glucometer does not have, and a colleague reading it will over-trust the figure. The safe habit is to write the value at the resolution of the instrument, keep the unit beside it, and remember that a round-looking entry is still a window on a continuous scale.

Why this classification is the foundation of every statistic that follows

The four-way split taught here is not a preliminary exercise that can be forgotten once the figures are collected; it dictates which analyses are legitimate downstream. A qualitative variable supports counting, proportions and cross-tabulation, and it is displayed as a bar or pie chart; computing a mean on it produces a meaningless number. A discrete variable supports totals, frequencies and, when its range is wide, an average count, and it is often displayed as a bar chart with a separate bar for each whole value. A continuous variable is the only kind that supports a meaningful difference between two readings, and it is summarised by an average and a measure of spread and displayed as a histogram or a line graph over time. The reasoning runs in one direction: choosing the wrong summary corrupts everything built on it. A ward that collapses a continuous glucose reading into “high or low” turns a quantity into a category and loses the size of the change; a ward that reports a mean from codes turns a category into a quantity and invents a value no patient has. Both errors survive into audit, quality indicators and published reports, where they are far harder to unpick. Nursing application makes the stakes concrete. If a quality audit asks whether a new admission protocol reduced readmissions, the number of readmissions is a count and the length of stay is a measured duration; the first is compared as frequencies, the second by average duration and spread. Deciding the type before collecting the data also fixes what must be recorded — a category needs a code list, a count needs an unambiguous definition of the event, and a measurement needs its unit and the resolution of the instrument. Getting that decision right at the start costs a minute and saves the whole analysis.

Explore the diagram

Look at the whole drawing first. Then select one numbered part and connect it to the idea you just read.

Variables and types of data

A two-question flow for classifying what a nurse records. The first question asks whether the value is a label or a number; labels end the routine as qualitative variables, while numbers move to the second question, which asks whether the value can be split. Countable whole steps give a discrete variable and values read from a graduated instrument give a continuous one. Four ward variables — blood group A, temperature 38.4 °C, admissions 3 and glucose 7.8 mmol/L — are carried through the flow to their types.

New to diagrams? Read this first
  1. Look at the whole drawing once without clicking anything. Ask yourself only: what kind of picture is this (a comparison, a route, a sequence, a table)?
  2. Press Play, or use the arrows, to move through the numbered parts in order. The drawing stays still; only the highlight moves.
  3. Click a number, or its name in the list below, to read what that part is and why it matters. Use “Hide labels” when you want to test your memory.
More controls
100%

01 / 5The first question: a label or a number

Variables and types of dataA two-question flow for classifying what a nurse records. The first question asks whether the value is a label or a number; labels end the routine as qualitative variables, while numbers move to the second question, which asks whether the value can be split. Countable whole steps give a discrete variable and values read from a graduated instrument give a continuous one. Four ward variables — blood group A, temperature 38.4 °C, admissions 3 and glucose 7.8 mmol/L — are carried through the flow to their types.The one decision:is the value a label or a number?Recorded valueDoes it name a category with no unit,or does it measure or count something?LABEL → qualitativeblood group, sexNUMBER → ask Q2temperature, admissionsA label names a category and has no unit.A number measures or counts something.Blood group A has no unit, so it is qualitative.Second question: can the number be split?Countable whole numbers (events, objects),or any value inside an interval?DISCRETE0, 1, 2, 3 …admissions = 3CONTINUOUSany value in an intervalglucose = 7.8 mmol/LCountable events cannot be halved:a patient cannot have 2.6 admissions.A measured value can be split further:7.8 could be 7.75 or 7.84 mmol/L.Four variables you record this shiftBlood group A → qualitative (a label, no unit)Temperature 38.4 °C → quantitative, continuousAdmissions 3 → quantitative, discreteGlucose 7.8 mmol/L → quantitative, continuous

If the drawing is wider than this panel, scroll it sideways. Labels stay readable; the numbered explanations below show the same ideas.

The first question: a label or a number

Classification begins with one question about meaning: does the recorded value name a category, or does it report an amount? Blood group, sex and type of disease name categories and carry no unit, so the routine stops there and they are qualitative variables. Temperature, weight, glucose and the number of admissions report an amount, so they continue to the second question. Asking about the database format instead of the meaning is the mistake that later produces an average of category codes.

Teaching flow, not a data-collection form. The thresholds shown (38.4 °C, 7.8 mmol/L, 3 admissions) are the section’s worked examples; the temperature and glucose intervals are illustrative of instrument resolution and are not clinical reference values.

Key points to remember

  • A variable is a characteristic that can take different values from one patient to the next; a constant does not change.
  • First question: is the value a label or a number? A label makes the variable qualitative; a number makes it quantitative.
  • Second question, asked only of numbers: can the value be split? Whole steps from counting events give a discrete variable; any value from measuring on a scale gives a continuous variable.
  • A whole number written on the page does not make a variable discrete. Temperature 39.0 °C and weight 70 kg are both continuous, because the instrument merely rounded.
  • The type governs the arithmetic: count and compute percentages for categories, add and average counts, and use differences for measured quantities. Never average a code.
Go deeper

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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).

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  1. 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.

  2. 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.

  3. 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 %.

  4. 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.

Lesson progress is saved on this device for the current learner. Practice answers stay separate and are not stored.

About this course and its sources

Bilingual lessons organised from the supplied BMS 1110 Applied Mathematics and Medical Biostatistics lecture notes (Mr. Ebangan Prosper Achuanoh). Diagrams are original educational schematics; sections that go beyond the supplied notes say so in their sources. Mathematics, clinical and French-language review are pending.