As to the need to re-elect him, we need to change the nonmedical values in that categorical variables
to numerical values by creating deliverables.
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.
One is this airport, which has two categories.
The other is water boarding, which has four categories Lake River, Lake none and would not create
dummy variables with numerical values for all the dataset.
That is, for all the categorical variables of your dataset.
In one go, we will install a package called Demis to install a package.
We can write in stalled out package and 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 dummy Dort
data
or data within Blackwood's.
We just need to specify our dataset, which is D.F. and we'll run this so long.
Let us 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.
Variable.
This contains one when the actual value of it for 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 lake.
We have one in this lake column where there was river.
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 it poured, variable has two categories, yes and no.
We need only one dummy variable for this.
So this important yes variable can alone serve the purpose as one will be present.
Yes.
And zero will represent no.
Similarly for water body.
We can keep these three variables which are water, body lake, water boarding lake and river and water
body river and will not need these.
Very well.
Variable waterboarding then.
So now we need to delete these two variables.
Waterboarding.
None.
An airport.
No.
To delete these two variables.
We need to get depletion of these two columns.
So one is at the SO airport is at the ninth column.
You can look at this box, which we get when I hold my mouse over this column name.
It put no is at the ninth column.
And the other one is.
A defined column.
So let's go and delete these two variables.
D.F. Gate, D.F. squared with good karma.
Minus nine.
Then this.
Now, this one rehabilitated.
The other one was at the 15th Fusion, which will now be 14th position.
You can check again.
We'll go to the waterboarding one column.
You can see it is at the deporting inquisition.
So we just change nine to 14.
And we'll run it.
You can see that now we have 17 variables.
So we have created dummy variables for these two categorical variables in our dataset.
All the variables in our dataset now have numerical values and we can run that regression.
Marylanders.