As to the need to re-elect him, we need to change the nonmedical values in that categorical variables
to numerical values by creating the military build, creating a dummy variable in software package like
art is very easy.
So we have two variables that are categorical in our dataset.
One is airport, which has categories.
Yes and no.
Let us open the database again.
When is this airport, which has two categories.
The other is water boarding, which has four categories like River Lake none.
And both.
Now, to create dummy variables with numerical values.
What did the data?
That is, for all the categorical variables of your dataset in one go.
You'll install a package called Demis to install a package.
We can write installed our package within Blackard and double quotation marks relate Demis.
And this to this package is a start, and you can look at this package if you go to the packages tab
on the date.
There is this dummy's package to Lawder.
You just need to click it on this checkbook's.
So basically, this package makes dummy variable creation easy.
Next, we need to write one single line of code to get the dummy variables relate D.F. get.
Dumi door bita.
Da, da, da.
I remember that good.
We just need to specify the desert, which is D.F. and we'll run this.
So Lawler, just click this variable to viewer.
So if, you know, scroll to the trade, you can see for airport.
We now have two columns, one where Edward where he will add value.
Yes.
And other for no.
So basically in this.
Yes.
Valuable.
This contains one when the actual value of it would very well was.
Yes.
And in this other column, it contains one if the actual value of it what it bought was No.
Similarly in the position of water body variable.
We have four new variables where there was a leak.
We have one in this lake column where there was revolt.
We have one in this river column and so on.
But if you remember, I told you that number of dummy variables is actually one less than number of
categories.
So as airport variable has two categories, yes and no.
We need only one dummy variable for this.
So this airport.
Yes.
Variable can alone serve the purpose as one will represent.
Yes.
And zero will represent.
No.
Similarly, for water money, we can keep these three variables, which are water, body lake, water
boarding lake and river and waterboarding river and will not need these.
This.
Very well.
Waterboarding then.
So now we need to believe these two variables.
Waterboarding, none.
An airport.
No.
To delete these two variables.
We need to get depletion of these two columns, the position of of airport.
Nobody able.
Is if we have over this, I.
We can see it is eight column.
And the other variable that we want to delete.
The position of this waterboarding column is 14 column.
So eight, 10 to 14 column will be deleting.
We will write the F get.
D.F. Square Records.
We want all the comma, minus eight.
Run this one video a little later.
Not since we deleted it column, the column which we counted as 14 cuddlier will be No.
13 to a few.
Jake, I mean, it is column number 13.
So you're right.
Bill Gates, D.F..
Square records, comma, minus lead on this.
Another variable is delivered.
And it does look at the data to confirm waterboarding.
None is deleted from this set.
An airport noise deleted.
So now all the categorical variables are converted to dummy variables and these dummy variables contain
numbers.
So now we can then add analysis on this dataset.