Types of Variables

Knowingly / unknowingly, we all tend to use mathematics and numbers in our day-to-day life for decision-making. We can live with basic mathematics skills for our routine grocery shopping. However, if you are an aspiring data scientist then it is essential to have a very good understanding of statistical concepts. Even before we dive into statistics, one should have an understanding of the types of variables. So, let us begin our discussion on numbers by looking at them as variables (e.g. Age, Occupation, Income, etc) and variable types.

Types of Variables

In Statistics, there are two types of variables. They are

    • Categorical Variable
    • Numerical Variable

Categorical Variable

  • The Categorical variable is also known as a Qualitative variable. It represents the characteristics of the data object.
  • Sometimes categorical variables take numerical values, but having numerical values doesn’t mean it has any mathematical meaning.
  • There are two types of Categorical variables. They are
    • Nominal Variables
    • Ordinal Variables
NOMINAL VARIABLE  ORDINAL VARIABLE
  • Nominal Variables have values that are ‘labels’ representing some category (or class). The values do not have any quantitative meanings.  or any relative ranking or order.
  • Nominal Data can be summarized by mode, frequency distribution, and proportions.
  • Example: Gender (Male, Female, or Transgender). The values of the variable Gender do not have any order. The statistics you can derive for such variables are mode, frequency, and proportions.
  • Ordinal variables have values that represent a category that has a relative order/ranking with other categories. The values do not have any quantitative meaning but have relative ranking or order. Example: Qualification level (Illiterate, Undergraduate, Graduate, Post Graduate). The qualification values show the relative education level between the individuals.
  • Ordinal data can be summarized by mean, median, mode, frequency distribution, and proportions. (e.g. mean of feedback rating is meaningful)
  • Sometimes ordinal variables may take numerical values. However, the difference or ratio of those values does not have any meaning. Example: Feedback rating given on a scale of 1 to 5 (1 being Below Average and 5 being Excellent). The ratio or the difference between the two values will not be meaningful.

Numerical Variable

  • Numerical Variable is also called a Quantitative Variable.
  • Numerical data is either an integer or a real value.
  • It has a mathematical meaning.
  • There are two types of Numerical Variables. They are,
    • Discrete Variable
    • Continuous Variable

Discrete Variable

  • A Discrete Variable can only take certain distinct and separate values. But, it cannot take any intermediate value between them.
  • Example: The number of transactions done by a customer on a particular day. It can 0, 1, 2, …. but it cannot be 2.5 or 2.75.

Continuous Variable

  • A continuous variable can only take any continuous value.
  • Example: Account Balance of the customer.
  • There are two types of continuous variables. They are,
    • Interval Variable
    • Ratio Variable
INTERVAL VARIABLE RATIO VARIABLE
  • The quantitative variables where the ratio of its values do not have any meaning and it does not have an inherently defined zero value are Interval Variables
  • The difference between the two values of the interval variable is meaningful, however, the ratio does not make any sense.
  • Ex. Temperature
      • Say the temperature in Kashmir is 1° C and the temperature in Mumbai is 35° C.
      • The ratio of Mumbai temperature by Kashmir temperature will be 35. If we make a statement that Mumbai is 35 times hotter then it would not make sense.
      • However, if we say the difference between Kashmir and Mumbai temperature is 34° C then it would be perfectly meaningful.
  • Interval variable does not have an inherently defined 0.
    • If the temperature of a particular city is 0° C then it does not mean that temperature does not exist.
  • The quantitative variables which are measured on a scale such that the ratio of its values are meaningful and they have an inherently defined zero value are called Ratio Variables
  • The difference or ratio between two values for ratio variables are both meaningful
  • Ex. Length of Conference Hall
    • Width of Road A is 120 feet and the Width of Road B is 60 feet
    • The ratio of Road A width to Road B width is 2. We can say that Road A is 2 times wider than Road B and this statement is perfectly meaningful.
    • The difference between the Road A width and Road B width is also meaningful
  • Ratio variables have an inherently defined zero value.
    • If we say the width of Road C is 0. It means the road does not exist.

Example:

Nominal Nominal Nominal Ordinal Discrete Interval Ratio
Emp_ID City Department Designation No. of Subordinates Months Since Last Leave Salary
2453 Mumbai Marketing Vice President 4 7 125000
2589 Thane Finance General Manager 7 6 80000
3048 Surat HR Manager 10 5 50000
2985 Chennai Operations Asst. Manager 5 4 30000
3184 Delhi Operations Executive 1 1 20000
1085 Mumbai Admin Office Boy 0 0 8000

Practice Exercise

Find the type of variables for the given deposit account data.

Acc. No. Acc. Type Acc. Open Date Length of Relationship (in Years) Gender No. of Txns. Closing Balance
1085100000065 CA 12-Jan-2020 0 M 5 79749.48
1085100000066 CA 1-Jan-2010 10 F 29 31905.80
1065100010065 CA 25-Jan-2015 5 M 15 339698.20
2085100000065 SA 10-Jan-2018 2 M 2 100.25
5000851000000 SA 15-Jan-2019 1 F 13 1000.00

Next Blog

In the next blog, we will discuss the measures of central tendency (Mean, Median, and Mode). The below table summarizes the best measure of central tendency for different types of variables.

Type of Variable Best Measure of Central Tendency
Nominal Mode
Ordinal situation-specific

(Mean, Median or Mode)

Interval/Ratio (not skewed) Mean
Interval/Ratio (skewed) Median

<<< previous         |         next blog >>>

<<< statistics blog series home >>>

How can we help?

Share This

Share this post with your friends!