Statistics
What Do Subsets Mean in Statistics?
This article explains what subsets are in statistics and why they are important. You’ll learn about different types of subsets with formulas and examples for each.
Sarah Thomas
Subject Matter Expert
Get a head start on your degree: 2for1 College Courses.
Statistics
02.17.2022 • 4 min read
Subject Matter Expert
This article explains the concept of discrete, continuous, and random variables. You’ll also learn the differences between discrete and continuous variables.
In This Article
To understand what discrete, continuous, and random variables are, you first need to know what a variable is.
In math, a variable is a quantity that can take on different values. It is a quantity that “varies.”
We typically denote variables using a lowercase or uppercase letter of the Latin alphabet, such as $a$, $b$, $X$, or $Y$. You can attach a subscript to the letter to provide more information about the variable. For example, if $h$ is a variable representing height, you might use h1 and h2 to differentiate between the height of two different people. Similarly, you could write $h_{male}$ and $h_{female}$ to differentiate between a variable that represents the heights of males and the heights of females.
Variables can be categorical or numerical.
Categorical—also called qualitative—variables consist of names and labels that divide data into specific categories. When you select your nationality or your race on a survey, those responses are categorical.
Numerical—also called quantitative—variables have values that can either be counted or measured. Discrete and continuous variables are specific types of numerical data.
A discrete variable is a variable that takes on distinct, countable values. In theory, you should always be able to count the values of a discrete variable.
Examples of discrete variables include:
Years of schooling
Number of goals made in a soccer match
Number of red M&M’s in a candy jar
Votes for a particular politician
Number of times a coin lands on heads after ten coin tosses
All of these variables take a finite number of values that you can count. They are examples of discrete variables.
A continuous variable is a variable that can take on any value within a range. A continuous variable takes on an infinite number of possible values within a given range.
Because the possible values for a continuous variable are infinite, we measure continuous variables (rather than count), often using a measuring device like a ruler or stopwatch. Continuous variables include all the fractional or decimal values within a range.
Examples of continuous variables include:
The time it takes sprinters to run 100 meters
The size of real estate lots in a city
The weight of baby elephants
The body temperature of patients with the flu
The deployment altitude of skydivers
None of these variables are countable. Each of them could take on an infinite number of values within a range.
Sometimes we treat continuous variables as if they were discrete.
Age is an excellent example of this. If you know a person’s time of birth, you could measure their age precisely up to the second or even millisecond if you wanted to. In this sense, age is a continuous variable. However, we don’t usually care about a person’s exact age. Instead, we treat age as a discrete variable and count age in years.
A random variable is a variable where the values are the outcome of a random process.
An easy example of a random variable is:
When you roll a die, the roll itself is a random event. The possible values of X are 1, 2, 3, 4, 5, or 6, but the specific value you get depends on the randomness of the event. It’s uncertain which number will appear on any given roll. You can learn more about events and the odds of of results when you read our article about math probability.
Random variables can be numerical or categorical, continuous or discrete.
The main difference between discrete and continuous variables is that discrete variables represent countable, distinct values, whereas continuous variables represent uncountable, infinite data, usually as measurements. Essentially, discrete variables have countable values like the number of toys in a box, while continuous variables have measurable values within a defined range like the distance you walk in a day.
The table below summarizes the key differences between discrete and continuous variables and provides a few more examples.
DISCRETE VARIABLES  CONTINUOUS VARIABLES 
Definition A discrete variable is a variable that takes on distinct, countable values.  Definition A continuous variable is a variable that takes on any value within a range, and the number of possible values within that range is infinite. 
Discrete variables have values that are counted.  The values of a continuous variable are measured. 
Discrete Variable Examples
 Continuous Variable Examples

Outlier (from the cofounder of MasterClass) has brought together some of the world's best instructors, game designers, and filmmakers to create the future of online college.
Check out these related courses:
Statistics
This article explains what subsets are in statistics and why they are important. You’ll learn about different types of subsets with formulas and examples for each.
Subject Matter Expert
Statistics
Here is an overview of set operations, what they are, properties, examples, and exercises.
Subject Matter Expert
Calculus
Knowing how to find definite integrals is an essential skill in calculus. In this article, we’ll learn the definition of definite integrals, how to evaluate definite integrals, and practice with some examples.
Subject Matter Expert
Plus, skip the line with guaranteed admission to Degrees+ when you pass both courses. Backed by our riskfree guarantee. Offer expires soon.
By signing up for our email list, you indicate that you have read and agree to our Terms of Use and Privacy Policy.
Plus, you’re guaranteed admission to Degrees+ when you pass both courses. Backed by our RiskFree Guarantee, Offer expires soon.
By signing up for our email list, you indicate that you have read and agree to our Terms of Use and Privacy Policy.
No joke—get any college course on us. Free. Simply complete an application to Degrees+ by Jan. 24th. Limited to the first 500 students. No commitment required.
Get started