Variables and Types of Variables

Kapil Pant
5 min readAug 26, 2020

--

A brief and didactic article about variables and types of variables in statistics.

The critically endangered hawksbill turtle is a highly migratory animal that lives in tropical waters. It is hunted for its striking shell.

Statistics is all about collecting data and recording variables and then using those to try and make generalizations about a population. So, let’s start with talking about what is a variable? A variable is a recorded piece of information or a characteristic about a person, a case or a unit in our study. So, variables are some characteristic info that is recorded for a person but it varies or changes from person to person. So, for example we might record the age of everyone in our sample and for everyone we are recording the age, the age is going to change or vary from person to person.

The way we approach summarizing and analyzing data depends largely on the type of variables that we have. Variables fall to one of two broad categories namely :

  • Categorical variables
  • Numeric variables.
Types of variables

What are categorical variables?

The first type of variable can be called as categorical and this also sometimes gets called qualitative. So, this places people into categories or records qualities about them.

What are numeric variables?

The other type of variable is labelled as numeric or we can also call this quantitative (it records quantity).

Before learning further about them let’s talk about how these can be further broken down. So, categorical variables can be further broken down into :

  • Nominal categorical variables
  • Ordinal categorical variables
Types of categorical variables

What are nominal and ordinal categorical variables?

Categorical variables like biological sex (male or female or other), country of birth, these sorts of things fall into the category of nominal categorical variables. Nominal means that there is no ordering based on magnitude or size i.e., there is no smallest to largest ordering. When you think of something like the size of coffee that someone orders, that is categorical (can be small, medium or large) but there is an ordering based on the size or magnitude. Small is smaller than medium, medium is smaller than large, so, there is an ordering or ranking to these categories. So, that’s what we call ordinal.

And numeric variables can be further broken down into :

  • Discrete numeric variables
  • Continuous numeric variables
Types of numeric variables

What are discrete and continuous numeric variables?

Discrete and continuous, it’s a bit more grey area between these two and they are often treated as same or very similarly in analysis. But discrete variables tend to take on integers only. So, things like 0, 1, 2, 3, in theory it can go all up to infinity but integers only. So, things like the number of people in a room (0 or 1 or 2 and so on). Continuous variables are measured on a continuous scale. So, when we record someone’s weight, we often record weight to the nearest pound or nearest kilogram but they are actually measured on a continuous scale. For example, your weight can be 57.258 kilograms.

Task :

So, now let’s take this list of variables and decide whether they are categorical or numeric as well as which scale of measurement is used. And you might want to take a moment and try and do this yourself before looking at the answer.

Answer :

Okay, so, let’s go through and place each of these variables into which type we think they are. So, age is a recorded quantity and it is continuous. But when we record our age, we record it to the nearest whole number, no one ever says that their age is 35.738 years old but actually is measured on a continuous scale. And now thinking about weight, again that’s a numeric measurement and it’s done on a continuous scale. Disease recorded (yes or no) is categorical and there is no ordering or ranking to these. Biological sex is recorded as male or female or other, that’s a nominal categorical variable. Country of birth, hair color are nominal categorical variables as there is no natural ordering to these. Income is a continuous variable. Number of life births in the hospital is discrete numeric variable. The size of coffee is a categorical variable and there is ordering or ranking to these. And finally, temperature recorded in degree Celsius is a numeric quantity and again measured on a continuous scale.

“Statistics are like bikinis. What they reveal is suggestive, but what they conceal is vital.” — Aaron Levenstein

Few important things to know :

  • Categorical variables sometimes are recorded using numbers but that doesn’t make them numeric. So, quite often, things like “someone has a disease” (yes or no) is recorded using 0s and 1s. 1 often indicating “yes” and 0 indicating “no”, or biological sex (male or female or other), we might record “male” as 0, “female” as 1 and “other” as 2. Another example is the liker scale, where we ask people that you strongly disagree, disagree, neutral, agree or strongly agree, and we often ask them to rank them using 1, 2, 3, 4 or 5. So, there we are using numbers to indicate categories.
  • You can always convert numeric variables into categorical variables. For example, we can take something like age and rather than using numeric age we can convert that or break it down into child, adult, and senior or we might just break it into age categories of [0–10], [10–20], [20–30], and so on.

Summary

In this article we explored how to summarize variables depending on whether they are categorical or numeric. A small task related to the same is mentioned above that ensures an informative understanding of different types of variables in statistics.

--

--

No responses yet