Variables

Today we are going to talk about types of variables.

What is a variable?

A variable is a factor or a feature which is liable to change. For e.g.: In an experiment , we took two vitamins,  A(microgram)  and C(milligrams)  to find out total amount of vitamin consumption by 50 people.

To calculate total amount of vitamin consumption, we have to first convert the SI unit of vitamin A to milligrams.  And to do this, we’ll divide vitamin A with 1000.

Hence, we get an equation:

x1/1000 + x2 = y

Over here x1 and x2 are variables which will change from person to person.

Now, we’ll see types of variables that one come across while doing work on data sets.

Dependent and Independent variables:

Dependent variables are those whose value depends on some other variable(s). These are also called response variables. In the above example, the total vitamin consumption(y) is the dependent variable as its value will change whenever we’ll change the values of vitamin A and C.

Independent variables are those variables whose values are not dependent on any other variable(s). In the above example amount of Vitamin A and C are independent variables.

Quantitative Variables:

Variables which have numeric values. These can be classified as Continuous and Discrete variables.

Continuous and Discrete Variables:

Continuous variables can take every possible value in its range. E.g.:  Weight of a person. It can be 43.2334kg or 63.2937kg.

Note: Age when mentioned in years is considered as discrete variable otherwise it’s a continuous variable. 

Discrete variables can take finite number of values. E.g.: Number of students in a class can have only finite values like 4, 44, 23 etc.

Qualitative/Categorical Variables:

These are the variables whose values can be any label or name. E.g.: Marital status, brand of Toothpaste etc.

Income can be quantitative as well as categorical variable. If the numerical values(12000, 45000, 22562)  of this variables are taken into consideration then it is a categorical variable and if the income is divided into various range eg. high, medium, low then it is a categorical variable.

There are two types of categorical variables: Ordinal and Nominal variables

Ordinal Variables:

These are the variables for which the possible values are ordered. The values of these variables have some mathematical meaning i.e. the values of such variable can be compared with each other. e.g.: The income level which can be divided into three categories high, medium and low is an ordinal variable since we know that ‘high’ value of income level is better than the rest of the two.

Nominal Variables:

These are the variables whose values do not have natural order. E.g.: the color of hair can have values red , grey, white , black. These categories can be labeled as : 1 for ‘red’, 2 for ‘grey’, 3 for ‘white’ and 4 for ‘black’. The values for hair color is not ordered i.e. it does not have any mathematical meaning.

Binary Variable:

These are the variables that can take only two values. E.g.: we have to find whether person is having malignant cancer, then its corresponding variable can have values either yes or no, another example can be of marital_status which can take only two values ‘married’ and ‘unmarried’.

 

 

Leave a comment

Start a Blog at WordPress.com.

Up ↑