Types of Variables

The text below is a transcript of the video above, edited with AI assistance for clarity and flow. Where the two differ, the video is the authoritative version.

You’ll learn to

In any research project, the choice of statistics, tables or plots that you are going to use depends on a lot of factors, the most important of which is the type of the variables that you are working with. In this video you will learn to:

  • Classify variables by type.
  • Evaluate how different types lead to different summaries.

Example: British Election Study, 2024

We are going to work through the example of the British Election Study of 2024. It asked its respondents four questions that we will look at:

  • What is your age?
  • On a 0-10 scale, where 0 means left and 10 means right, where would you place yourself?
  • What is the highest qualification you have?
  • Which party did you vote for in the general election?

Age

The first question asked respondents their age.

Age
Obs 3,029
Mean 52.85
Std. dev. 18.88
Min 18
Max 95

The “Obs” there means the number of observations: 3,029 people were asked their age. The mean is what is also commonly known as the average. It is the result of taking the sum of the ages of all respondents and dividing by the number of respondents. So you sum up everyone’s ages, then divide by 3,029. The mean age was 52.

The answers here are numeric quantities, and age has a true zero: zero means an absence of age. We are going to see that this is not true for every numeric measurement that we can have for variables. We can also make comparisons such as saying that a 40-year-old is twice as old as a 20-year-old. These are the properties that define a ratio variable: age is a ratio variable.

Ratio variables

Ratio variables come in quantities that have a true zero. Additional examples are a country’s GDP, a country’s population, or a person’s income. Zero here means an absence of GDP, an absence of population, an absence of income or, in the case of age, an absence of age.

We can compute the mean, as we just saw with age, and make mathematical operations with a ratio variable, such as dividing a country’s GDP by its population to get the GDP per capita. These are the properties of ratio variables, the first of the four types of variables that we are going to look at.

Ideology

The second question was: on a 0-10 scale, where 0 means left and 10 means right, where would you place yourself?

Ideology (0-10)
Obs 2,677
Mean 4.75
Std. dev. 1.95
Min 0
Max 10

The British Election Study got responses from 2,677 people who placed themselves on this 0 to 10 scale. If you sum up the answers of every person and divide by the number of people, you get a mean of 4.75.

The answers here are numeric quantities, like age. But unlike age, zero here is not a true zero, in the sense that zero does not mean an absence of the variable. It does not mean an absence of ideology; the zero here means left. And we cannot say that someone who placed themselves at four is “twice as much to the right” as a person who answered two. These are the properties of interval variables: ideology is an interval variable, the second type of variable in this video.

Interval variables

Interval variables come in quantities that do not have a true zero. Additional examples are temperature measured in Celsius or Fahrenheit, or a person’s credit score.

We can compute the mean of an interval variable, but we cannot make certain mathematical operations with it. We could not do what we did with the two ratio variables, GDP and population, dividing one by the other to get the GDP per capita. Interval variables do not allow this type of operation or this type of comparison. A country can be twice as rich as another country in terms of GDP or GDP per capita, but when we are looking at ideological placement, for example, we cannot make the same type of comparison or the same type of mathematical operation.

Education level

The third question that we are looking at from the British Election Study is the education level. People were asked: what is the highest qualification you have?

Education level (summary) Frequency
No qualifications 728
Below GCSE 98
GCSE 294
A-level 436
Undergraduate 1,014
Postgrad 385
Total 2,955

Here, instead of showing the mean, this is a frequency table. It shows how many people said no qualifications, how many said below GCSE, and so on up to postgrad, with a total of 2,955 people.

The answers are categories, not quantities. We are not looking at quantities of education; they are levels, and they are ordered. They are clearly ranked: some answers are placed above others in terms of the respondent’s educational attainment. So the education level is an ordinal variable, the third type of variable.

Ordinal variables

Ordinal variables come in categories that are ranked in a specific order. Additional examples include how strongly a person agrees with a statement: strongly agree, agree, disagree, strongly disagree. These are not quantities. They are categories of level of agreement, but you can rank them in a set order.

We can compute the means of certain ordinal variables, but we must always be careful about how we interpret those means. Take how strongly a person agrees with a statement. You could have one meaning strongly disagree and five meaning strongly agree: you could attach numbers to those categories and calculate a mean. But the interpretation of that mean requires more caution than the interpretation of the mean of a ratio variable. The mean of age, for example, has a more straightforward interpretation than the mean of an ordinal variable.

General Election vote

Finally, the fourth question, which reflects a fourth type of variable, asked British Election Study respondents which party they voted for in the general election.

2024 General Election vote Freq. Percent Cum.
Labour 895 43.74 43.74
Conservatives 408 19.94 63.69
Liberal Democrats 224 10.95 74.63
Scottish National Party (SNP) 75 3.67 78.30
Plaid Cymru 22 1.08 79.37
Green Party 148 7.23 86.61
Reform UK 221 10.80 97.41
Other (WRITE IN) 20 0.98 98.39
An independent candidate 33 1.61 100.00
Total 2,046 100.00

There you have the numbers of respondents who voted for each political party in the 2024 general election. For example, 895 of them voted Labour, so the most frequent value in 2024 was Labour.

The answers here are categories, not quantities, and those categories cannot be ordered. These are the properties that define a nominal variable: the General Election vote is a nominal variable, the fourth type of variable that we are looking at in this video.

Nominal variables

Nominal variables come in categories that cannot be ranked. You cannot place parties above one another. Additional examples include a person’s gender or a country’s electoral system type: whether a country uses proportional representation or first past the post, for example, is a nominal variable.

We cannot compute the mean or, thinking about data visualisation, draw a histogram for a nominal variable.

Recap

  • There are four types of variables: ratio, interval, ordinal and nominal.
  • Variables differ in the kind of information they carry.
  • The type of a variable constrains which summaries and comparisons make sense. This has very important implications for every step along the way in any research project, so being mindful of the types of the variables you are dealing with is one of the most important parts of any quantitative research project.

Why this matters

Misclassifying variables can lead to incorrect interpretation, not just technical mistakes. And our choices of graphs, models, and statistical tests depend on the types of variables that we are analysing.