OK, so now let's see how to transform this crime rate with evil so that it has a Moodley no relationship
with price.
That's bloddy scatterplot once again between crime rate and price.
We can do this in two ways.
One is which we saw earlier, is Beyer's
and bracket after the right price plus crime rate
price plus crime rate.
Commentators you call to be.
So you can see it gives us the plot of the to where he was that we have taken.
This we used to plot multiple scatter plots at the same time.
But if you have only two variables, you can plot scatterplot using this and other command, which is
plot and within records will write D.F. Dollard place, comma de lower crime rate.
You've done this.
So this is a lot of two variables, and it is a normal scatterplot.
Now, if you look at this Plourde, the relationship seems to be a curve like this.
This girl looks like a logarithmic function, which is a little bit translated and rotated.
Therefore, we just need to take a log of crime rate to have a Moodley no relationship with price.
Also note that a lot of values of crime rate are nearly zero and log of zero is negative infinity.
And we know we do not want such values in our data.
So we'll simply add one to crime rate and then we take a lot of it.
So let's do the change and crime rate variable.
Simply laid the F dollar crime rate.
Get logoff one plus B if the lower crime rate one plus the F dollar grinded.
To the values of the variable crime rate has been changed.
Now, let us plot this graph again.
We'll just go to the plot on land or net again.
Now you can see that the variable has transformed and now there is some linear relationship that we
can identify in these two variables.
That is all we need you to do to have a model in a relationship between two variables.
So now this is an to be put into a model.
But remember, once we ran the model that we have taken a log off a variable and we'll have to handle
it later.
Then we get the analysis.
Next thing we are going to do is transformation of the forward distance variables into one average distance
variable.
For that, we need to create a new variable and that variable will take the values some of the four
dissenters the way before.
So we rate the F dollar average, underscore, distance it with underscore, disked
this gate.
So this variable is not part of DEEDI, does it?
So this will be created.
And what value really get aggregate the sum of all the standard variables which are which are based
on this to this three.
This four.
So will within brackets relate this one day of dollar?
This one.
The if the largest one plus.
They have told this to.
And just for new it before when we done this, a new variable is created.
If you remember that earlier our data had 19 variables.
Now it has 20 variables.
And this variable is having the average value.
If we want to look at the new variable created, you can just click on this.
And if you scroll to delayed.
This is the new variable created.
And this value, this 4.0 eight is actually the average of these four values.
So we will be using this average just very well in our analysis and will not be using defore distance
variables.
So let us see how to delete these four variables from my data to delete a variable we need to get says
its position in the dataset.
So we will go back to the data and we'll look at where this discovery will is.
So this is the first Gollum's again, third, fourth, fifth, sixth, seventh.
So we want we do not want seven, eight, nine, ten, ten columns in our data.
So will rate beef get?
Beef and within square brackets, this first barometer is for the number of rules.
We want all the rules, so we'll not mention anything.
And we'll simply put a comma here.
After this coma, the second perimeter is about the number of columns that you want, if you want all
the columns.
Do not mention anything here.
If you want some of the columns, you can mention that column numbers if you want to remove some columns.
We will use minus sign here.
So we'll rate minus seven to minus 10.
So we'll use this column operator to give that.
It is a series, so it is a series from minus seven to minus 10.
If you are not sure about whether this will remove the correct columns, you can also create a new variable
instead of assigning this value to the if you can assign it to be of two.
So let us change it to be of two.
So I'd be off to variable is created.
Now you can see that it has 16 variables for all the variables have been deleted.
To look at that will click on it.
Let's see if before that it was this one, this two, this three have been deleted.
You can see we cannot find them.
They are deleted from our dataset.
So we can assign the value of these two to be, if you will, just eight be a physical to be of two.
The city of two and really the lead of two will late autumn Blackett leave to
be two is gone.
We have D.F. if you remember there was one categorical variable called bus terminal, which had only,
yes.
Values, and we decided that we would be diluting that variable also.
And if you look at the data said, this is the variable I'm talking about.
It has only yes.
In it.
And we decided that we'll be deleting it.
So let us go and delete this variable also from our say.
So let us calculate the position of this column.
So the position we have identified is the 14th column will write that same statement again, D.F. Gate
B, if I was in square brackets, we will not take the 14th column.
So minus 14.
Let's fundus let's go back to data and check.
You can see that bus terminal variable is also deleted.
So after doing all these operations, if you remember, if we go back to the four observations that
we identified when we did univariate analysis, I think we have covered all these four.
We have handled the outliers.
We have imputed the missing values.
And Osbert, we ability the bus terminal very well.
And we have manipulated the crime rate variable so that it has a more linear relationship with the price
variable.
All the things we identified from univariate analysis we have handled.