And by ridded analysis, I told you that we knew scatterplot and correlation matrix to understand the
relationship between two variables.
Now, let us discuss in detail these coalitions that we see in a coalition matrix.
So when do we say that variables are correlated, when the values of those variables fluctuate together?
We say that video was a quality that positively correlated.
If one variable almost always increases, when the other one increases and negatively correlated, if
one decreases, when the other one is increasing.
For example, if you think logically, there should be a positive correlation between calorie intake
and a person's weight.
That is if you increase your calorie intake.
You should have more weight.
And if you reduce it, you should have listened with.
Similarly.
Amount of time, one studies should impact the GDP of that student.
So this means they should have some coalition as well.
However.
Selecting variables with no commonality results in non correlated variables.
For example.
A dog's name and the type of biscuit the dog will prefer will not be called Elegy.
So easy for such scenarios.
Correlation is nearly zero.
You can think of any bizarre combination of two variables and most probably should have low correlation.
The quantification of correlation is called correlation coefficient.
There is a statistical formula to compute the correlation between two variables.
Although the formula is simple, but since we will never find our correlation coefficients for our data
manually, we will always be using some sort words to do this.
We will not be discussing the formula here.
Oh, just gnawed certain characteristics of coalition coefficient.
First, its value is between minus one and one.
So plus one means that is 100 percent positive correlation and minus one means hundred percent negative
coalition.
Secondly, zero value of coefficient indicates that there is no relationship between the variables.
You can see the graphs here.
The first one shows a positive correlation.
That is, if one value on the X axis is increasing, the value on the VIAJES is also increasing.
The middle one is representing no correlation.
Even if you increase the value of one of the variables, the other one does not change.
The third one is showing negative correlation.
That is, if you increase value of one variable, the value of other value will is going down.
As a rule of thumb, if you find the value of coalition coefficient as less than point one, we say
that there is very low correlation between the two variables.
And if we find that it is more than point eight, we say that it is very high correlation between the
variables.
It is important to note the difference between coalition and causation correlation is just representing.
Whether the values in two variables for our sample data set are moving together or not.
But it does not tell us anything about cause effect relationship between the two.
We cannot say that because correlation coefficient is as high, that increase in one variable will lead
to increase or decrease in the other variable.
Take this example.
This example shows the values of U.S. crude oil imports from Norway and the number of drivers killed
in collision with rail between.
You can see from this graph itself that both of these values are going hand-in-hand.
If you find out the coalition between these two values, this coalition is coming out two point nine
for.
That is nearly 95 percent.
Such high value of good coalition.
May lead you to think that these two variables are highly correlated.
An increasing one of them may lead to increase in the other one.
That is not the case.
These two are completely random.
Two variables.
And they do not have any relationship amongst themselves.
So to establish cause effect relationship, one of the most common ways is to use the intuition to look
back at deep business knowledge and to find out whether the change in one of the variables actually
impacted change of the other very well or not.
The other method is a difficult one.
It is setting up a scientific experiment where we manipulate the variable in a controlled environment
and see the impact on the other variable.
Will not be covering that in this.
ElectriCities.
But just in case you are doing a controlled experiment, that is one of the options that you have.
So far, our data say.
We'll be depending on the business edition.
To establish causation.
When you have a dataset with multiple variables, we may want to see the correlation coefficient for
each pair of variables.
There is a tabular format in which we take all the variables on top.
Like this and all those variables on the left all too like this.
And then for each combination of these two variables.
So for this never to try to evade taxes and always toward elections.
So this sale to this combination of these two variables, correlation coefficient is mentioned in the
corresponding cell.
This table is called Coalition Matrix.
If you look at this matrix, these diagonal values.
And actually decorrelation of that variable with itself.
So basically, whenever this variable increases, this is also increasing whenever this is decreasing.
This is also decreasing.
And they are going perfectly hand-in-hand.
That's why this value is always going to be one.
All the values on this diagonal are going to be one.
And this value, which is giving us the correlation between all this to vote in elections and never
to try to evade taxes.
This point, not ninefold value will also come in here because these two variables are also present
as rows and columns for this sale.
If you look at this metric carefully, this matrix is basically having a mirror image of itself about
this diagonal.
So this particular cell is same as this in this particular cell.
Same a diesel.
This is same a diesel.
So basically it is a mirrored image about this Tigner.
Once we get this matrix, we can easily see these patterns in our data.
That was the primary goal of making this matrix.
Another useful feature of this matrix is that you can quickly find out which two independent variables
are highly correlated.
But why are we trying to find out coalition values between two independent variables?
We are doing this because whenever there is correlation, there are two correlated variables are moving
together.
Therefore, if one of them is leniently littered individually with the dependent variable, then the
other one will also show linear relationship with the dependent variable.
But when you will take both the variables in your model and model has to assign relative importance
to each of them, really tedious job for the model.
Every time you will show your model a new sample of data, it will assign different edition coefficient
to these variables.
This problem for the model is called vertical linearity.
Therefore, it is important that we identify highly correlated independent variables and remove one
of the two so that multicore linearity can be avoided.
But which one of the two would you remove and which one you'd keep?
First, try to keep the one which makes more business sense if both make business sense.
Look at the correlation coefficient of both.
With the dependent variable, whichever is higher, you may want to keep that one and remove the other
one.
If both of them are having the same coalition cohesion, then you may go and pick the variable for which
the data is easier to get.
This is the use of correlation coefficient, correlation matrix.