Discrete variable

A discrete variable is a variable which can only take on a finite number of values. There’s a limited number of possible values that the variable can take on.

Importantly, there are gaps between the possible values of a discrete variable. (if it’s a number) For example, if we have a variable which can only take on the values 1, 2, and 3, then it cannot take on the value 1.5, or 2.7, or any other value between 1 and 3 - they’re gaps.

Discrete vs continuous variables

Continuous variables are the opposite: they can represent any value, sometimes within a certain range. For example, a continuous variable could represent any value between 0 and 1, including 0.5, 0.25, 0.75, etc. There are no gaps between the possible values of a continuous variable, either. There are actually infinite possible values that a continuous variable can take.

Discrete variables have a limited number of possible values they can take.

Discrete vs categorical variables

Categorical variables are also different from discrete variables. Categorical variables represent categories or groups, and they don’t have a natural order. For example, the variable “colour” could be a categorical variable with categories like “red”, “green”, and “blue”.

We can sometimes call these ‘qualitative’ measures. They’re different from discrete.

Examples