Next, important thing we need to know is how to handle the categorical variables in a set of independent
variables.
If you remember it, in our data dataset, we have variables like IT board, which has values.
Yes and no.
And there is a variable called Water Body, which has values such as lake.
There were several.
No immigration model works on real Limbert's.
It really don't understand a nonmedical evil such as airport.
Oh, can we handle this problem?
It is simple, we just need to assign a numerical value to each of the categories of that variable.
If the category names are numbers, the creation model can run.
But we cannot assign any number to the categories as this will impact the modern.
We need to follow proper process.
So this process of properly creating a dummy variable, which will represent an actual variable containing
non numerical values, is called dummy variable creation.
The way we do it, because regression analysis cannot handle it, non numeric data.
And how we do it.
We first create a new variable or a set of variables.
That is the dummy variables.
Then these new variables are given values of either zero or one and not anything else.
But why?
Why not we assign values like one, two and three or tetra.
Let's just look at the categories in this example for classification.
On the left, I have students and their favorite subject on the right.
I'm calling this object.
The first step of dummy variable creation is creating dummy variables.
All many dummy variables.
Do we need to remember this, the number of dummy variables required to replace every one is number
of categories in that video.
One minus one.
That is, if there are two categories, we need to minus one, dummy variables.
That is only one dummy variable.
If we have three categories, like an example, we need three minus one.
That is two dummy variables.
So I have to resort to science, English and Max.
So I have created two dummy variables, one for science and one for Max.
Science has value one.
If the subject is science and it has value Z2.
So if you look at the first two, it has scientists one.
And the other two were these objectives, English and math.
It has value zero.
Matt has value one.
If this object as bad as it has value, do so.
The fourth rule as one in the match column and all the other rules as Z2.
This means if voters do you, then this object is English.
So the third rule as both zero, which is representing the third subject.
Really, these zeros and ones are representing each category.
I'll be favorite.
Plus, even.
Now, to answer the question why we created two dummy variables, then we could have created a single
one with value, such as one for signs, two formats and three English.
This is because one, two, three have more meaning.
That is.
They do is actually two a fun.
But match is not higher than our modern science.
Math, science and English are nominal data.
It just says the name of the favorite subject.
So we cannot assign numerical values which can be ordered.
That has been viewed as ending zero and one it only two percent, true or false?
What do you signal?
Therefore, we create in minus one dummy variables.
The value of each dummy variable is one for one single category and the net category as all.
As zero value for all the N minus one dummy variables.
I'll do interpret the results of a regression analysis containing dummy variables ordered like this
will be discussed after we run the ignition on our data.