Skip to content
Glacius
StatisticsConcept reference

Data variables

A numerical variable records amounts, while a categorical variable records category membership.

On this page 7 sections
  1. Overview
  2. A variable records a characteristic of each observation
  3. Read a field’s definition
  4. Categories may have an order, such as low and high priority
  5. Key takeaway
  6. Sources & further reading
  7. Concept connections

01A variable records a characteristic of each observation#

A variable records a characteristic of each observation. A numerical variable records an amount, such as a count or a duration. A categorical variable records a label, such as a region.

The number 33 could mean “busy” in a status code or three milliseconds of elapsed time. The meaning determines the variable’s class.

Both boxes show the stored value 3. The left field is status code, where 3 means busy. The right field measures duration in milliseconds, so 3 is an amount. The identical digits have different meanings.Both boxes show the stored value 3. The left field is status code, where 3 means busy. The right field measures duration in milliseconds, so 3 is an amount. The identical digits have different meanings.
Figure 1Both boxes show the stored value 3. The left field is status code, where 3 means busy. The right field measures duration in milliseconds, so 3 is an amount. The identical digits have different meanings.
Link to this figure ↗Download SVGDownload PNG
Check your reasoning

Meaning: number of waiting jobs. Stored: 5. Classify.

  1. ANumerical: an amount.
  2. BCategorical: a label.
  3. CNumerical: digits measure.
Show answer and explanation
Numerical: an amount.

It counts waiting jobs.

02Read a field’s definition#

Read a field’s definition. A code can use digits without measuring an amount. A duration written as “five seconds” still describes a numerical measurement.

Check your reasoning

Dictionary: zone=code for region; seconds=duration. Classify zone.

  1. ANumerical: an amount.
  2. BCategorical: a label.
  3. CNumerical: codes count regions.
Show answer and explanation
Categorical: a label.

Zone labels a region.

03Categories may have an order, such as low and high priority#

Categories may have an order, such as low and high priority. Numbering those labels does not by itself turn the gaps between them into measured amounts.

Check your reasoning

Meaning: category identifier. Stored: 42. “Digits mean numerical.” Repair.

  1. ANumerical: an amount.
  2. BNumerical: codes count regions.
  3. CCategorical: a label.
Show answer and explanation
Categorical: a label.

42 is a label.

Key takeaway

Read what the variable represents. Counts and measurements are numerical; category labels remain categorical even when encoded with digits.

  • Classify a variable from its meaning.

Sources & further reading

  1. [1]
  2. [2]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Data variables.” Math behind ML. /learn/s-variables