Types of variables

sri hari
Nerd For Tech
Published in
3 min readMay 18, 2021

Whenever we build a ML model, we need to know about variables in our dataset to decide the which Ml model to be used. Since we are about to work with variables, let’s know about the types of variables.

There are two major types of variable, one is categorical and another one is numerical.

Catergorical variable:

Catergorical or qualitative data is divided into categories or groups. It is the measures of ‘types’ and may be represented by a name or symbol

Example: gender, level of education, animal name, brand name etc,..

Catergorical variable gets furt6her classified into two types,

Nominal variables:

It is just a variable of labeled categories without any quantitative value.

Example: 1. Gender — male, female 2. Hair color — Black,brown,blonde

Ordinal variables:

In this variables, order of the values is significant but difference between those values are unknown.

Example:1. Satisfaction level — low, middle, high 2. Rank of employee — I, II, III

Numerical variable:

Numerical or quantitative data can be measured and the measures of values or counts are expressed as numbers.

Example: age, salary, tenure, etc,..

Numerical data gets further classified into two types,

Discrete variable:

Discrete data can only take certain values.

Example: the number of students in a class will a whole number like 52, there won’t be 51.5. We can’t have half a student.

Continuous variable:

Continuous data can take any value(within a range).

Example: weight — 61.5kg , Time in a race — 5.05min(5 minutes and 5 seconds)

Overall we have following hierarchy of classification of variables or data,

There are another two types apart from this,

  1. Grouped data and
  2. Ungrouped data

Ungrouped data:

The raw data that we gather from a experiment/study which is not sorted into categories or classified. It is just a list of numbers.

Grouped data:

Grouped data is data that has been bundles together in categories.

Hope this blog gives a clear understanding on types of variables or data.

Thankyou! :-)

--

--

sri hari
Nerd For Tech

Student from Coimbatore Institute of Technology, R and D engineer trainee