Tutorials › Introduction to Statistics › Identifiers, Categories, and Numbers: A Classification Clinic

Variables, Data Types and Questions · Tutorial 14 of 996

Identifiers, Categories, and Numbers: A Classification Clinic

Classify familiar data fields by their meaning, distinguishing numerical labels from quantities that support meaningful arithmetic.

Beginner 9 min read

What You'll Learn

  • Distinguish numerical-looking labels from quantitative variables.
  • Classify postal codes, room numbers, and identification codes by their role.
  • Explain why age in completed years remains quantitative.
  • Recognize visit counts as discrete quantitative variables.
  • Check whether arithmetic on recorded values has a meaningful interpretation.
  • Avoid treating missing-value codes as observed categories.

Why the Meaning of a Value Matters

A data field can contain digits without measuring an amount. A postal code such as 02139 and a room number such as 314 look numerical, but their digits usually identify a place rather than quantify something about it. By contrast, a person's age or number of clinic visits describes an amount, so comparisons and arithmetic can be meaningful. The key is to classify a field by what its values stand for, not by how they are written.

This distinction matters because a numerical summary can be calculated even when it has no sensible interpretation. Averaging postal codes, room numbers, or patient identifiers does not produce a meaningful “typical” value. The same rule applies to strings of digits stored in a computer: storage format alone does not make a field quantitative.

Definition: A categorical variable records which group or label applies to an individual. A quantitative variable records an amount for which differences and, where appropriate, arithmetic have meaning. An identifier is a label used to distinguish or locate an individual or record; it is not a measurement of that individual.

A categorical variable may have nominal categories, which have no inherent order, or ordinal categories, which do have an order. A quantitative variable may record a count or a measurement. These are distinctions already useful when examining mixed data fields: the first asks what kind of values are represented, and the second asks how quantitative values arise.

A Reliable Classification Check

For each field, ask what a single recorded value means for one individual or record. Then ask whether subtracting two values would describe a meaningful difference in the measured attribute. If the values are labels, the difference between their codes is usually arbitrary. If the values are quantities in a defined unit, differences can carry meaning.

1
Read the field definition.
Identify what each value represents, and identify the individual or record to which it belongs. Do not classify from the column name or appearance alone.
2
Check whether values are labels.
If a value names a person, place, group, or record, it is categorical or an identifier, even if written with digits.
3
Check whether values are amounts.
If values count occurrences or measure an attribute in defined units, the variable is quantitative. Then note whether it is a count or a measurement and what precision the data record.
4
Check exceptional codes.
Values such as “unknown,” “not applicable,” or a special code for missing data do not automatically become observed categories or numerical amounts. Interpret them using the data definition.

A useful thought experiment is to imagine replacing every label with a different code while preserving which records share a label. If that replacement changes the mean or differences between codes but changes none of the real-world information, those arithmetic results were not meaningful in the first place.

Worked Example: Postal Codes and Room Numbers

In a hypothetical campus health-center file, each appointment record contains a patient's postal code and the room number where the appointment took place. Some postal codes are 02139 and 02140; room numbers include 214 and 318. Classify both fields.

Postal code. The value identifies a geographic area associated with the patient. It is categorical, not a measurement. Postal codes are labels: 02140 is not one unit “larger” than 02139 in a quantitative sense, and the leading zero in 02139 may be essential to the label.

Room number. The value identifies a room. It is also a categorical label, not a measurement of room size or distance. The difference \(318-214=104\) does not mean that room 318 is 104 units larger or farther away than room 214.

A facility might define a separate variable for the floor, building, or distance between rooms. That field could answer a different question, but it does not change the meaning of the room-number field as defined here. If room-number digits encode a floor by local convention, that structure should be used only when the data definition explicitly says so; it is not a license to treat the whole room number as a measurement.

Quantitative Fields: Age and Visit Counts

Age and visit count both describe quantities, but they represent different kinds of quantities. Age measures elapsed time since birth. A visit count records how many events occurred in a defined period. The way either value is recorded can affect its precision, but does not turn a genuine quantity into a label.

Key distinction: A quantitative variable has numerical values with meaningful quantitative interpretation. A count takes nonnegative whole-number values for the number of occurrences. A measurement records an amount on a scale with specified units and precision. A quantity recorded in rounded or grouped form remains quantitative, although its recorded values carry less detail than the underlying quantity.

Worked Example: Age Recorded in Completed Years

A hypothetical registration form records each patient's age as completed years. One patient's entry is 24, meaning that 24 full years have elapsed since birth, while the next birthday has not yet occurred. Classify the field and explain what the value means.

The field is quantitative, because age represents elapsed time and differences in age have a meaningful interpretation. For example, an age of 30 completed years represents six more full years elapsed than an age of 24 completed years.

The entry 24 is not an exact age of 24.0 years. It means that the person's elapsed age is at least 24 years and less than 25 years. Recording age in completed years truncates the elapsed age to the number of full years; it does not round to the nearest year. For example, an elapsed age of 24.6 years is recorded as 24 completed years, not 25.

The recorded values are whole numbers, but that does not make age a count of events. They are coarsened measurements of elapsed time. A report should preserve the field's definition and say “age in completed years,” rather than implying that the recorded value gives an exact age.

Worked Example: Counting Clinic Visits

Suppose a hypothetical clinic file has one row per patient and records the number of visits each patient made to the clinic during a specified calendar year. For five patients, the recorded counts are 0, 1, 1, 2, and 4. Classify the field and describe what a summary means.

The variable is quantitative and discrete: each value counts visits, so it can take nonnegative whole-number values. The unit is visits per patient during that year. The values 0, 1, 1, 2, and 4 sum to 8 visits across five patients, and their mean is

$$ \bar{x}=\frac{0+1+1+2+4}{5}=\frac{8}{5}=1.6 $$

Thus the mean in this hypothetical set is 1.6 visits per patient during the specified year. A mean need not be an attainable individual count: no single patient in this set had exactly 1.6 visits. It summarizes the total number of visits divided by the number of patients.

The time window and unit are part of the interpretation. “Number of visits” without saying for whom and over what period may be ambiguous. Also, this field is a count, not a rate: a rate would require a defined denominator such as person-time. Here the recorded quantity is simply the number of visits for each patient during the stated year.

Identifiers Are Not Measurements

A patient ID, appointment number, or student number can be stored as digits and may even be unique for every record. Its purpose is to distinguish records, not to describe an amount. Identifiers are useful for linking or locating records, but calculating their mean or treating their numerical order as a meaningful scale is inappropriate.

The reason can be made precise. Suppose three records have identifiers 101, 102, and 103. Their mean is \(\bar{x}=102\). If the same records are relabeled 701, 109, and 450, their mean becomes

$$ \bar{x}=\frac{701+109+450}{3}=420 $$

The records and everything substantively measured about them are unchanged; only the arbitrary labels differ. Since the mean changed from 102 to 420 without any change in the underlying individuals or outcomes, the mean of these identifiers does not describe a stable feature of the data. This is why numeric appearance is not enough to justify quantitative treatment.

Some fields serve more than one practical role in a database. A room number may identify a location, and a postal code may be useful for grouping records by area. Those uses are categorical: records can be grouped by matching labels. If a researcher wants a quantitative quantity such as travel distance, that quantity must be separately defined and measured; it cannot be inferred by subtracting the location labels.

Missing Codes and Mixed Fields

A mixed data file may contain a field whose valid values are numbers but also includes special entries such as “unknown,” “not recorded,” or a code such as 999. A special entry should be interpreted from the data documentation. If 999 means missing age, it is not an age of 999 years and should not be included as an observed quantitative value. Similarly, “not applicable” is not necessarily a substantive category of the variable.

A practical classification should therefore state both the intended variable and any coding issue. For example: “Age in completed years is quantitative; the value 999 is a missing-value code, not an observed age.” This avoids mixing the meaning of the variable with the mechanics used to store incomplete records.

Worked Example: Classifying a Campus-Health Data Record

Consider one hypothetical record per student who used a campus clinic. The file includes student ID, postal code, age in completed years, number of clinic visits during the academic year, and appointment room number. Classify each field from its stated meaning.

Student ID: identifier. It distinguishes students or links their records; its digits are not a measured quantity.

Postal code: categorical geographic label. It can be used to group students by postal area, but the numerical difference between codes is not a meaningful distance.

Age in completed years: quantitative measurement of elapsed time recorded as the number of full years. It is not rounded to the nearest year; an elapsed age of 24.6 years is recorded as 24 completed years.

Number of clinic visits during the academic year: quantitative discrete count. Each value gives the number of visits for one student in the defined period.

Appointment room number: categorical location label. The digits identify a room, but arithmetic on them does not measure room size or separation.

The individual in this file is a student, and the fields describe or identify that student or their clinic use. Classifying each field depends on the meaning stated in its definition, not on whether its stored value contains letters or digits.

Common Mistake

  • Wrong reasoning: “This column contains integers, so it is quantitative; therefore, I can average it.” This confuses the format of a value with what it represents.
  • Correction: First establish what one value means. A postal code, room number, or ID is a label even when made of digits. A count or measured amount is quantitative because its numerical differences have an interpretation.
  • Related pitfall: “Age in completed years is rounded to the nearest year.” Completed years mean the number of full years elapsed, so the value is truncated to a whole number of elapsed years. Rounding would be a different recording rule.
Key takeaway: Classify a field according to its real-world meaning. Postal codes, room numbers, and IDs are labels or identifiers; age is a quantitative measurement even when recorded in completed years; and visit totals are quantitative counts when the individual and time period are defined.

Check Your Understanding

For each field, decide whether it is categorical, an identifier, or quantitative, and give a brief reason.

  1. A hospital record contains a five-digit patient number assigned only to distinguish records. Is its numerical order meaningful?
  2. A patient aged 31.8 elapsed years is recorded as 31 completed years. Explain the classification and what the recorded value means.
  3. A campus survey records how many days each student visited the library during September. What type of variable is this, and what are its unit and time window?
  4. A clinic file stores postal codes as text with leading zeros preserved. Does storing them as text change their underlying classification? Explain.
  5. A room field contains 215 and 402. What information do these values provide, and what cannot be concluded from their difference?