Python for Data Science: Chapter 4: Descriptive Analytics

Types of Variables

Descriptive Analytics

Types of Variables - Descriptive Analytics

Questions: 1.Give one example each of a discrete and continuous variable from your daily life. 2. Why can't height be a discrete variable? 3.Give difference between qualitative and quantitative data.

Types of Variables

In data science, we collect data to understand the relationship, pattern or trends. Each piece pot of data is called variable.

Definition of variable: A characteristic, number or quantity that can change or take different values is called variable.

For example ‒ A student's marks, height, customer ratings.

Variables can be classified as shown in following Fig. 4.2.1.



1. Quantitative(Numerical) variables

■ These variables can be measured numerically. They represent quantities i.e. something which we can measure. For example ‒ Age(years), Height(cm or feet), Salary(in Rupees).

■ Quantitative variables can be further classified as (A) Discrete variables (B) Continuous variables.

A. Discrete variables: The discrete variables are those variables that can take only specific, countable values(whole numbers). There are no fractions or decimals in this type of variables.

For example ‒ Number of students in a class(50), number of cars in Parking slot(20).

B. Continuous variables: These are the type of variables that can take any values within a range, including fractions and decimals. They are measured not counted. For example ‒ height of a person(155.5 cm), Temperature(32 °C), Time taken (5 minutes and 20 seconds)

Difference between Discrete and Continuous Variables


Discrete Variables

1.These are countable values.

2.These variables contain whole numbers only.

3. For example ‒ Number of employees.

Continuous Variables

1. These are measurable values within a range.

2. These variables can include decimals

3. For example ‒ Height, temperature.

 

2. Qualitative(Categorical) variables

■ The qualitative variables are those variables that represent qualities or characteristics. They are not numerical. These variables normally represent categories or labels. Hence they are also called as categorical variables. For example ‒ Blood Group (A, B, O, AB), Mobile brands(Samsung, OnePlus, Apple).

■ Qualitative variables can be further divided into two types ‒

A) Nominal variables : These variables represent the categories with no natural order or ranking. For example ‒ Color of Eyes (Black, Brown, Blue), Types of cars (SUV, Sedan)

These are names or labels and all are different, none higher or lower.

B) Ordinal variables: These variables represent the categories that have meaningful order or ranking, but the difference between ranks is not measurable. For example ‒ Customer satisfaction levels(Poor, fair, good, excellent). Or Education Level (Primary, Secondary, Graduate and Post Graduate).

Difference between Nominal and Ordinal Variables


Nominal variables

1.There is no specific order.

2.These are categories with no ranking.

3.For example ‒ Blood Group or Gender.

Ordinal variable

1. There is some order.

2. These are categories with logical order.

3. For example ‒ Education level, Customer satisfaction.

Difference between Quantitative and Qualitative Variables


Quantitative variable

1.These are measurable numerical data

2.The subtypes are‒Discrete and continuous.

3.For example ‒ Age, Salary, Marks.

Qualitative variable

1. These are descriptive or categorical data.

2. The subtypes are ‒ Nominal, Ordinal.

3. For example ‒ Gender, Blood group.


Dependent and Independent Variables

When we study relationships between variables, we usually have two main types of variables.

a) Independent variable: These are the variables that we change or control. It influences or causes changes in another variable.

For example ‒ Dose of Insulin given to the person.

b) Dependent variable: This variable that we measure or observe. It changes because of the independent variable. For example ‒ The blood sugar reading of the person (it depends on the units of insulin given to the person).


Review Questions

1.Give one example each of a discrete and continuous variable from your daily life.

2. Why can't height be a discrete variable?

3.Give difference between qualitative and quantitative data.

 

Python for Data Science: Chapter 4: Descriptive Analytics : Tag: Computer Programming, Python, Data Science : Descriptive Analytics - Types of Variables


Python for Data Science: Chapter 4: Descriptive Analytics



Under Subject


Python for Data Science

AD25201 2nd Semester AIDS Dept | 2025 Regulation | 2nd Semester 2025 Regulation



Related Subjects


English Essentials II

EN25C02 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation



Linear Algebra

MA25C02 2nd Semester | 2025 Regulation


Applied Physics (CSIE) II

PH25C03 2nd Semester AIDS, CSE, IT, CSE(CY) Dept | 2025 Regulation | 2nd Semester 2025 Regulation


Digital Principles and Computer Organization

CS25C06 2nd Semester AIDS, CSE, IT, CSE(CY) Dept | 2025 Regulation | 2nd Semester 2025 Regulation


Basic Electrical and Electronics Engineering

EE25C01 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation


Python for Data Science

AD25201 2nd Semester AIDS Dept | 2025 Regulation | 2nd Semester 2025 Regulation


Re-Engineering for Innovation

ME25C05 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation


Python for Data Science - Laboratory

AD25201 2nd Semester AIDS Dept | 2025 Regulation | 2nd Semester 2025 Regulation