From the co-founder of MasterClass, earn transferable college credits from the University of Pittsburgh (a top 50 global school). The world's best online college courses for 50% less than a traditional college.

Are you confused about the difference between discrete and continuous variables? You're not alone! Many people need help understanding the distinction between these two types of variables.

In this article, we’ll start with the basics and cover each of the main types of variables used in statistical analysis. We’ll then dive deeper and give you lots of examples to illustrate the difference between discrete and continuous data.

What Is a Variable?

In statistics, variables represent values that can change.

Here’s an example.

Suppose you’re a fitness trainer who wants to collect data on the number of pushups your clients can do before any training. You build a data set with 2 variables: your clients’ names and the number of pushups they can do. Both are variables because the data you collect will vary with each client.

You could add many more variables to this data set. For example, you could add variables for the age of your clients, how much prior training they’ve received, how many seconds they can hold a plank or anything else you’re interested in tracking.

In a data table, we store variables in the table's columns, with each column representing a different variable. Each row in the table shows one recorded “observation” for your data, and each cell stores a value.

In the data table below, we see the description of our variables listed in column headers. Five observations represent data for 5 clients, and 5 values are recorded for each variable.

Quantitative vs. Qualitative Variables

We can divide variables into 2 types: qualitative variables and quantitative variables.

Qualitative Variables

Qualitative variables—also called categorical variables—are identifiers such as names and labels that divide your data into subgroups or categories. Variables representing names, religion, race, and political affiliation are all examples of qualitative variables.

We can further divide qualitative variables into nominal and ordinal variables.

Nominal Variables

Nominal variables are qualitative variables with no inherent ranking based on magnitude or size. Names, nationality, and religion are all nominal variables since there is no way to rank the groups within these categories.

Ordinal Variables

Ordinal variables are qualitative variables where each subgroup can be ranked in order of magnitude. Education levels are a good example. If I collect data on educational attainment, I’ll have categories like high school graduate, some college, college graduate, Master’s degree, or Ph.D. You can rank these categories according to how much education a person has received.

Quantitative Variables

Quantitative variables—also called numeric variables—are variables representing quantities or measurements. The number of pushups a person can do is a quantitative variable, as is how long they can hold a plank.

Discrete variables are quantitative variables that take on discrete countable values. Discrete variables are almost always in the form of whole numbers or integers. The number of pushups a person can do is a discrete variable. We can easily count pushups. A person may be able to do no pushups, 3 pushups, or 10, but the number won’t be a decimal or a fraction like 10.305 or 11.532.

Continuous Variables

Continuous variables are quantitative variables that can take on infinite values within a defined range. We often need a measuring device, like a stopwatch or a ruler, to measure continuous variables. How long a person can hold a plank or run a 50-meter dash are examples of discrete variables.

We would need a stopwatch to measure such variables, and the values we record could be any of an infinite set of real numbers like 00:09.02, 00:53.13, or 02:34.35.

Here’s some insight into sampling data and methods:

What Is a Discrete Variable?

Now that you know the main differences between different variable types, let’s look at more examples of discrete variables.

Remember, a discrete variable is a quantitative variable that can only take on countable values. The values are most often whole numbers or integers.

Discrete Variable Examples

1. The Population of the US

The population of the US, or any other country, is a discrete variable. The population will always be a whole number; in theory, that number is countable.

2. Age

Though age could be considered a continuous variable, we often treat it as discrete. This is because we don’t care if a person is 32 years, 3 months, and 5.238 days old; we only care that they are 32. So long as we are counting age in years, age is a discrete variable.

3. The Number of Students in a Classroom

The number of students in a classroom is also a discrete variable. You would never have 7.5 students in a classroom or 35.23 students. The value you measure will always be a countable whole number.

4. Customers at a Coffee Shop

Like the number of students in a classroom, the number of customers at a coffee shop is also a discrete variable. The shop might have 30 or 85 customers an hour, but it won’t have a fractional value of customers.

5. Number of Rainy Days in Various Cities

A city's number of rainy days over the course of a year is another example of discrete data. This variable will always have values that are whole, countable numbers.

What Is a Continuous Variable?

Now, let’s look at some more examples of continuous variables. Continuous variables can take an infinite set of values within some range.

Continuous Variable Examples

1. Distance

Distance traveled is an excellent example of a continuous variable. The distance a person walks or drives daily could be any decimal within some range. There are an infinite number of possibilities.

2. Time

Similar to distance, the time it takes for something to happen requires measurement and can take on an infinite set of values within a range. For this reason, time is also a continuous variable.

3. A Student’s GPA on a 4.0 Scale

If we measure grade point averages on a scale of 0.0 to 4.0, the resulting variable is continuous.

4. Volume of Coffee Sold in a Coffee Shop

This is also a continuous variable. Volume is measured and can take on decimal values.

5. Inches of Rain Various Cities Get in a Year

Unlike the number of rainy days in a city, which is a discrete variable, the amount of rain in a city is a continuous variable. A city might get 12.4 inches of rain or 55.73 inches of rain. The possible values for this variable will fall within some range, but the possible values are countless.

Discrete vs. Continuous Variables

In summary, here are the main similarities and differences between discrete and continuous variables.

Outlier (from the co-founder of MasterClass) has brought together some of the world's best instructors, game designers, and filmmakers to create the future of online college.