High in this session, we will discuss about the next wave of Chi Square test, which is Chi Square
test for independence.
Now, in the case of the guys who did this for goodness of fit, we saw that a particular value, a
set of value, which is categorical in nature, they tried to find out the proportion of these values
and try to deduce things about the population distribution using the square based of goodness of the.
Now, what do we do in case of this for independence, so did this for independence can be used and
interpreted in two different ways?
The first way is testing hypotheses about the relationship between two withi within a population.
That is initially we were talking about one single video, but that is one categorical variable and
that category.
The video had multiple values in it.
Let us see the eye color being brown, green, blue and other.
So this was about us in the video.
But here in the square of independence, we are talking about the videos.
So you see the difference between the goodness, if it was about just one particular frequency distribution
people, about one categorical variable, which we were talking about, but here we have two withI.
And the other reading this about differences between proportion four to one world population, so one
is about the relationship between the variables or the differences between the water, though.
Now, if you try to analyze these two statements, they are kind of similar.
Only one is trying to find out if two variables have some relationship or not, and another one is trying
to find out if they do have some independence or differences or not.
So it's one and the same thing.
If they are able to find out about two population variables are having some similarity or differences
or not.
That is that can be considered just one null hypothesis only.
So we don't need to be the sole solution here.
We need just one good problem to solve.
So the only defense would you need to take care of here is that the goodness effect is regarding one
categorical variable.
While the test for independence is regarding two or more populations, two variables present in different
populations.
So either they could be to population and we want to find out if these two populations are different
or not.
Or we could have two variables, insane population.
And we want to find out if there is any relationship between these two of these two peoples.
This could be something like a number of hours someone is studying.
With respect to if they're scoring good or not, so here we have the same population, but we want to
find out if the number of hours a person study has some relationship with the of the marks with the
score they are getting on.
So let us get for the.
Now, although the two versions of the test of independence appear to be different, they are equivalent
and they are interchangeable in nature.
The first version of the test emphasizes the relationship between squit and of coordination because
both procedures examined the relationship between two people.
So here we are having squared all joint coordination models.
It kind of emphasizes between guys when information if we're able to relate it to each other or not,
while it determines whether there is an association between categorical variables, also known as a
squared test of association or a test of independence, is also known as good as Twatt Association.
So we are checking if the city was associated or they are independent.
I'm just trying to find out the relation between two videos.
So a very small square statistic means that the absorbed data puts your expected data extremely.
In other words, there is a relationship between two evils.
If the guy is square, the value is very small.
It will mean that there is a relationship between the variables.
If the square value is very large, then it will mean that the data does not fit very well.
That is, it does it does not have any relationship.
That is those two with equals, which we are trying to compare and we are trying to find out an association
for are not related.
And that independent of each other.
Right, so the subscripts see here is the degree of freedom and the formula remains the same, if you
see the formula is just exactly what we had for the formula, for the goodness of it.
Just have a look.
You.
See, of the value minus expected value will square divided by expected what is the formula here?
The families observe minus expected equals squared divided by expected.
So the formula is exactly the same.
The problem is.
Let us go ahead now.
This guy squared value, which we have this whole value, which we have is value for.
This is an equation political and this is the these are the different goals which are generated from
this equation.
Now, what do these different colors signify, these different goals for different different values
of the.
Degree of freedom.
So here we have different degrees of freedom and you can see four different degrees of freedom.
We have the free golf screed.
And as the degree of freedom increases, it it it it somehow represents a normal distribution, so as
the degree of freedom will increase, the people will move towards being a normal distribution.
So let us have an example here.
So here we have a public opinion poll which is surveyed on a simple random sample of thousand voters
support a number of people, which we have here is a thousand.
And people of people who responded would classify it by gender.
That is, either they were male or female.
Now, this is our first video, which is a categorical variable that a person is a male or a female.
What is the next category?
The next is the.
Voting preference of a person that is a person is Republican, Democrat or independent.
So this is, again, a categorical variable, that is if a person is a public Democrat or independents
and another one is the gender of the bush.
So these are two variables which we have in Square Woodenness office.
We had one right now for this.
This is the baby, which we have.
This is the values that we have.
That is there are four hundred million six hundred females which were taken in the sample.
And out of these four, 450 were Republican, 450 Democrat and hundred were independent.
Now this is the data which we have.
Now we want to find out if there is a particular gender gap.
Do men's voting preferences differ significantly from the women of preferences?
So we are trying to compare if the voting preferences of male and female are different or is there any
relationship between both of these?
Now, we could have seen that if the number of male and female would have been similar, if the number
of male and female would have been five hundred and five hundred, then we could have seen if the values
were significantly different.
But here, the problem is that because it is a random sample, the number of male is willison, the
number of female.
So we cannot really determine anything from this data, which we have, so that is why we will be doing
the squarest.
Now, how do we do that?
So we will be doing that by performing of kriesel steps.
OK, now what is the null hypothesis here?
The null hypothesis is that the gender and voting preferences are independent.
That is, no, there is no relationship between the gender and voting preferences.
That is me do not really vote for Republican or female, don't vote for independence.
So these are.
Different viewpoints, which could have been there, but there is no such dependency, right?
They are completely independent.
While the alternate hypothesis is that gender and voting preferences are not independent, that is,
gender is actually impacted by the voting preferences of voting, preferences are actually impacted
by the gender.
If they have a particular gender voting more, then there is a chance of one particular party winning.
Right, but we want to find out if that is true or not.
So we have created this NALAN alternate hypothesis.
Now, what are degrees of freedom now here, the degree of freedom will be the product of a number of
degrees of freedom, rule of law and degrees of freedom of the column.
What is it?
Here we have two values.
So here, the degree of freedom will be one.
Here we have three values, so here the degree of freedom will be to the total degree of freedom will
be to.
Right, so how do we find out the degree of freedom?
So the first thing which we will be finding out will be degrees of freedom.
Now, here is the number of levels for one categorical variable, and C is the number of level for the
other categorical variable.
This is how we find out the degrees of freedom.
Next value is the expected frequency.
Is that is what is the expected frequency value?
How do we find that out?
The expected frequency count are computed separately for each level of one categorical variable at each
level of the other, categorical.
So we will be finding out the expected value for this, for this, for this.
So for each and every data point, which we have here, we will be finding the.
Expected value for these.
Now, how do we find that out?
It will be the number, the expected number of rule into expect the total number of those, the total
number of values in the column divided by the total number.
Right.
So and that is what is the total number of sample observations I can level out of the variability and
in total number of sample observations at levels of variability and is double the number that the sample
size.
OK.
So this will be nothing but.
For this, what will be the value for me versus representative?
The value will be for 50 in the four hundred divided by thousand.
What will be for this one?
This will again be 450 Endou four hundred divided by a thousand.
Right now, what is or C or C is the opposite of the frequency.
So what will we observe?
Frequency?
Four million devices in the public.
It is two hundred fifty million republic.
It is 250 for female and Democrat.
It is three hundred for male and Democratic is 150 for male and independent.
It is 50 for female and independent of is 50.
So this is how we find ourselves of values.
OK, now we are doing the calculations, so the calculated value will be degree of freedom comes out
to be to how the number of rulers minus one and the number of columns minus one.
That is the minus one one and three, minus one, two, two, plus one is equal to two, then these
are the different values for expected values.
So you can go back to the values here and compare how these values are calculated.
And similarly, we have the observed values already present and based on the expected value and the
observed value, we can find out guys statistics.
So what will be the guys for statistics?
Guys with statistics will be of value minus the expected value squared divided by the expected value.
And then we take a sum of all of these observations, all of these guys good values, what each and
every little column value.
So it comes out to be sixteen point two, you can pause this video.
And verify the values, do the calculations on your own.
And then to.
So these are the values, so you can calculate these values accordingly.
Now here with the degree of freedom is two and square value is sixteen point two.
So for this, if we go to the guys table, then four degrees of freedom do sixteen point two will come
where?
This is the value, this is the degree of freedom do and the value is sixteen point something.
Now you can see that the value sixteen point something is Vitullo.
Here also, you can see four degrees of freedom to.
Sixteen point two comes way above zero point zero one, which means that these we have to reject the
null hypothesis.
So what was the null hypothesis?
The null hypothesis was that the GENDEREN voting preferences are independent, but because we have rejected
the null hypothesis so we can conclude that there is a relationship between gender and voting preferences.
So this means that if a particular agenda votes more than the other agenda, then there is a chance
for a particular party to win, right?
So this is what we have in the square, sort of independent.
So next we will be discussing about a one which is another set of test, which we will be discussing
in the next session.
Thank you.