High in this session, we will discuss about the next set of tests, which is Guy Square Test.
So we have two types of test undercut.
Square one is the test for goodness of fit and the other one is the best for independent.
And these two tests are non parametric hypothesis tests using these type of sticks.
So we will learn about what guys of statistics is and how we can perform these duties and when are we
actually going to perform these tests.
So first of all, let us talk about non parametric.
What do we mean when we say these are known parametric hypothesis testing?
So the total non parametric refers to the fact that these guys squared this do not require assumptions
about population barometer's, nor do they test hypotheses about population barometer's.
Now, the tests which we have conducted, that is the Z test and the deepest both of these tests was
revolving around the population barometers.
We were trying to find out either what the population barometer should be or we were trying to compare
a particular sample of the population to find out if this sample actually belonged to the population
or not.
But in this case, we are not comparing with the population, we are not trying to find out something
about the population, we are just analyzing about the data at its.
So previous examples of hypothesis tests such as the fetus are barometric test, and they include assumptions
about barometers and hypotheses about the parameters that is the mean of the population should be of
one population, should be greater than something or not or mean of the populations are equal or not,
or we know one population is greater than the other population of a particular treatment.
So these kind of problems were there.
For example, we would come betting that if there is a kid who has some disease, then he will have
little number of or more number of broken.
So that is one assumption which we are making here.
We wanted to compare if a kid who is 80 is different from the population of the kids who are not in
and comparing the population mean for the number of broken beat.
So that was what we were doing.
We were comparing to two samples of children.
One sample had kids who have a particular disease, and another sample was of the kids who did not have
any disease.
And we were comparing the mean value of the broken between them.
So there we were considering these two to analyze about the whole population, that we have all those
children in the world and we take samples and we find out the mean of all the children who are ill and
all the children who are naughty, then is the mean number of their broken needs would be equal or not.
That is what we were trying to find out to that.
But here we are trying to find out a different thing.
Now, what does this.
The most obvious difference between Chi Square test and the details hypotheses we have considered is
the nature of data.
So in the desert we had a different type of data.
And in Geisler, we will have a different type of data.
What type of data would be then we will seen something.
Now, in case of Chi Square, the data are frequencies rather than numerical scores.
So in case of deepest, what did we have in case of a.
We had different children and a different data about children and for each children, each child, we
had the number of broken teeth.
He will have another child, the number of broken bones she will have and so on.
Now, here we have a particular new medical school or we can see a particular marks and an exam that
the child would not be.
So these are different things which we were comparing earlier and gives of the best and safest.
But now, in case of Chi Square, we are not comparing the numerical value, but we are actually comparing
the frequency of the data that for a particular thing, there are 20 children available or there are
20 children who are the.
So we are talking about frequency here instead of the data related to them, not about the height of
the children, but actually the number of the children who would represent this kind of data would be
that.
And to clarify more, we will take some examples of that.
You'll have a better understanding of this.
So let's get further, and the first test, which we will be talking about is the guy is quirkiest of
goodness of.
Now, the guy's got this for himself, it uses the frequency data from a sample to test the hypothesis.
And what does this hypothesis here, what is the hypothesis in case of Woodenness offered, the hypothesis
is about the shape or proportions of the population.
So here we are trying to find out if a particular sample which we have is having a particular shape
or not.
That is, if the population will follow a particular type of distribution or not, that is what we are
trying to find out here and we are trying to find out.
Let's see, we have a sample X and we have the entire population.
So we want to find out that the.
Distribution that we are gaining from this particular sample would fit into a particular distribution
or not.
That is why it is known as woodenness of.
We are trying to find out if we have this particular sample with 10 or 20 values, then willing to fit
a normal distribution or it will fit any other type of distribution.
So that is what we are trying to find, OK.
Now, here, the guy square test is used to test it for a sample of data came from a population with
a specific distribution.
That is, it is belonging to a specific distribution or not.
Now, every individual in the sample is classified into one category on the scale of measurement.
So we will have different categories in case of this particular test.
Earlier, we had just some numerical values, but here we will have certain categories.
And based on those categories, we will have a number of people being allocated to that particular category,
maybe 20 male and 30 female.
So this kind of data would be available.
Now, the data called absorbed frequencies simply count how many individuals from the sample are in
each category.
So basically we get to know that how many people are belonging to the category or category B and C and
so on.
So.
What does the guy square this, what would this fit for?
The null hypothesis specifies the proportion of the population that the bag should be in each category.
That is how much of a particular population should belong to each category.
If each category should have equal number of people in them, or there should be more number of people
in one category and less number of people in the category.
So this is what the null hypothesis would be about.
And the proportions from the null hypothesis are used to compute the expected frequencies that describe
how the sample will appear if it were in a perfect agreement with the null hypothesis.
So basically, we create a null hypothesis, which will imply that latency there should be equal number
of male and female for a particular service and B, on having those equal number of male and female.
But we have this is what null hypothesis would suggest, that we should have 20 million, 25 million
in this particular survey giving a particular opinion.
Now we want to find out if the actual data, which we have, because what we have now is a sample of
the data.
And a sample might have less number of middle and high number of female.
That is a possibility.
But because this is a sample we cannot see straight away about the number of people in the population,
because maybe when I took a sample, there were nine being male.
I'm twenty one female.
But in the population actually there were four hundred million four hundred females, which is an equal
number.
So here we want to find out if the distribution, which the sample is showing, is putting into the
distribution, which the population would do.
So we want to find out what the distribution of the population, which it will be giving up.
So let us see here.
So here we have a frequency data of different eye colors.
And it says that there are 12 people with blue eyes, 21 people with brown eyes, three people with
green eyes and four people with other eye color.
Now we want to find out if let us say all people will be there will be all colors are equally present.
And so we are comparing the people in the entire world.
And this is the sample which we have.
And based on the sample we want to derive, if all the people in the world will have same color I same
quantity of eye color or not, or the same proportion of white colors or not, that is, let us see.
Twenty five percent people will have blue eyes next.
Twenty five percent people will have brown eyes next.
Twenty five percent will have green eyes and the rest.
Twenty five percent will have other colors.
So this is what we want to prove here.
This is worth something which we are trying to do here.
So this is what the null hypothesis would be, that all the people we have seen, Michael.
Now, this is what we would try to accept or reject or find notable.
So this is the main objective here to find out about the guy that is.
Using the frequency of data which we have.
So this is what Gry Square test provides us and helps us in finding.
Now, let us have a look at an example so considered a standard bag of milk chocolate Eminem's and there
are six different colors in an eight.
So what are different colors?
We have red, orange, yellow, green, blue and brown.
So these are the six colors which we have now.
Suppose that we are curious about the distribution of these colors and we like the the production of
the Eminem's.
Does it happen in equal quantity or they are there creating a particular color would incorporate into
some of the color.
So we are trying to compare these categories, these colors as a category and we are trying to find
out if they're if the categories are equally uplifting in the same proportion or that is a particular
category see orange or green, which are being produced and the rest of being produced less.
So that is something which we are trying to compare here.
So do all the six colors in the equal proportion.
Now, this is the type of question that can be asked with a witness list.
That is what is the proportion of the values which are being created out of all the different colors
or what are the proportion of different eye colors present in the wood?
All right, so let us see what is the proportion of the transportation people are using, comparing
what we learned or four wheeler that is a car or maybe a bus or train.
So how are people actually commuting?
What is the proportion?
So these are different kind of questions which could be asked.
Now, let us ask a question that why do we need guys Squit?
So we begin by noting that the setting and why the goodness of this is appropriate, so we will find
out that what is the need of this?
So here we have a variable, which is categorical now because this is a categorical data and there are
different levels of data presence in this particular case.
That is why we will be using squarest.
OK, so whenever we have categorically done, we have certain levels then we can use Guisewite.
Now, we assume that the Eminem's recount will be simple, random sample from the population of all
Eminem's, that is, we will assume that all the counts will be same.
That is all of these Eminem's will be appearing in same proportion.
So that is what we are assuming.
So once we have the made the assumption that all the six colors are present in the same proportion,
then we will.
Creating an alternate type.
Now, what are the Nalin alternate hypotheses these will be?
Reflecting the assumption that we are making about the population, so we are testing whether the colors
will occur in equal proportions or not, so this will be all null hypothesis that all the colors, all
the colors of this a.m. are occurring in the same proportion.
That is when the company is actually producing these product, they are producing these in equal quantities
and randomly pushing them into different packages.
That is why the numbers are coming out to be different.
But actually the Eminem's which are being produced are same.
No, OK.
So what is the null hypothesis, the null hypothesis is if the one is the population proportion of red
candies, then BIDU is the population of orange candies and so on, then the value of the would be equal
to BIDU is equal to be three is equal to four is equal to be five is equal to be six.
That is all the proportion, all the number of candies being created are seen.
The production is same for all the six colors.
This is a null hypothesis.
What is the alternate hypothesis, the alternate hypothesis is that at least one of these colors.
Is not equal to the others, that is at least one of the population proportion is not equal to one sixth
of the entire population.
So this is what our null hypothesis, an alternate hypothesis will.
Now we've got to find out the actual and the expected outcomes.
So what are the actual count?
The actual count will be the count of the Eminem's, which we find out in a particular.
And the expected count will be the sum of all the values divided by six.
That is the exact expected count, so the actual count as the number of Gandy's, what each of the six
colors which we find out in the frequency and the expected count refers to the what we would expect
if the null hypothesis, what's true.
So we will check be the size of our sample and the expected number of red candies will be in by six.
If the entire sample is in, then the number of red candies will be in BASIX.
Number of orange candies will be in by six and so on.
Right.
So for this example, the expected number of Gandy's for each of the six colors will simply be in Times
VI or in BASIX, that is the the number of the entire sample divided by six.
So let us go further.
Now, let us apply the guys to find out the squad statistics.
So if the null hypothesis were true, then the expected count for each of these colors would be one
by six in six hundred, where the total number of Gandy's is six hundred.
So let's say the total number of cammies for this particular date, the sample data, which we have
is six hundred.
So for this entire six hundred, we expect that there should be one by six hundred that this.
Hundred counties of each and every color.
But what is the actual value which is coming out, actual value shows that blue is two hundred and twelve
oranges, one for the seven, green is one hundred and three, red is 50, yellow is forty six and brown
is 42.
So this is the frequency and we were expecting a hundred of each actually now, so we will now use this
in calculation for the statistics of how we will find that out.
We will find that out by subtracting the expected value from the observed value.
Taking a square of that divided by the expected value.
So what is the value here?
It is one, two hundred and well, the expected is one hundred, so two hundred and twelve minus hundred
who is square divided by one hundred?
Similarly, we will calculate the value for all the different categories.
That is all the different colors which we have.
And then we will take some of these.
So the sun comes out the week to thirty five point four to.
This to thirty five point four is the guys square statistics.
It is, these guys are sarcastic one.
So this is the value which we have found for these guys sticks.
Now we will find out the degree of freedom now what is the degree of freedom?
This is the table which we will be having.
This is the table which we will be having and the people will have the degree of freedom on the left
inside the vertical column on the.
The fee value will be present in the role here in the top role here, so we will be comparing it to
zero point zero five.
For this particular scenario, now, if you see what will be the degree of freedom we have in those
six values here.
So we have six values, then we can freely select five values out of this and one value would have to
be fixed.
Or any of the one value will have to be fixed and we will have to begin randomly select any.
Five values.
So here, the degree of freedom will be fine.
That is six minus one, the number of degrees, minus one.
So the degree of freedom is five and we are looking at the P value to zero point zero five.
So four degrees of freedom value for zero point zero five is eleven point zero seven, and what is the
square value which we have?
We have 235.
Now, if we look further forward for the smallest, we value the.
Value is a stylistic value is zero point zero zero one.
This gives us twenty point five one five, which is still lead to less in comparison to the guys square
statistics, which we got.
So what does this imply?
This implies that we have a very small p value and hence we will be able to reject the null hypothesis.
Even if the value would have been anything greater than eleven point zero seven zero, we would have
rejected the null hypothesis, considering the P value to be zero point zero five, which is a standard
P value.
OK, so this is the reason why we are rejecting the null hypothesis and we are saying we are clearly
able to see that the different colors of Eminem are not acting in same proportion, but actually have
some different proportions associated.
So they are not producing these colors equally.
They are creating a few colors, more in number and a few colors.
And they said no, the reason could be anything.
Maybe the production cost is impacting or maybe the popularity of those colors, but they are creating
them in different proportions.
You see, this is something which we have gained from this guy's school statistics test and we were
able to derive something from this.
So this is how you will apply Chi Square statistics for goodness of fit for any example.
So this is for the first example, we will discuss about this second example now, so what is this example?
So here we have another problem.
So earlier we were curious about the number of Eminem's that if they are producing them in the same
number, the next problem which we have is that we have a casino game which involves rolling off three
doses.
And the winners are basically proportional to the total number of sixes ruled.
So if someone has.
So how would be finding out the winners we are finding out the winners based on the number of success
they will be rolling in the hours of these three.
Right now, suppose a gambler plays the game a hundred times with a given of the phone.
So this is the observed count for a particular gambler that he had zero sixes.
That is 40 times one six thirty five times double sixes, 15 times, and three sixes to the ace.
So we want to find out if this gambler is playing with a good conscious or not.
So is there something wrong with the dice or not?
They saw the casino become suspicious of the gambler and wishes to find out if the dice up there or
not.
So how do they conclude that?
What do they find out by these observations?
So, again, what do we want to find out here?
Here we have these four categories.
We have these four categories and we have these expected gowns and the absolved gowns now out of these
observed gowns, we want to find out if this is actually a good fit to the normal distribution, which
we have for Dice's or not.
Now, this is the expected gown which has been generated from the probability.
Now, how do we find out the value, guys, good value for value will again be calculated by Absol value,
minus expected value, whole square of this.
Calculation divided by the observed value and the summation of this calculation for all the food, that
is right.
So how do we find that out for the minus fifty it square divided by fifty eight plus or minus thirty
four point five, square divided by fifty eight and so on.
Now.
What do we do for them now?
This is equal to one point seven to zero point zero zero seven plus nine point one four one four plus
twelve point five plus twenty three point is equal to twenty three point three six seven.
So the value which we get is twenty three point three six seven.
Now, the degree of freedom will be four minus one, so the degree of freedom is three.
So, Jake, what degree of freedom, three.
And the value of zero point zero five.
For this, the value has to be greater than seven point eight one to be rejected.
Now, because twenty three point three, six seven is greater than seven point eight one five, so we
can reject the null hypothesis.
This means that the biases are not felt right.
The null hypothesis was that the biases are bad.
That is why it will be a part of the distribution.
But because the it is of the significance level.
So we can easily see that the dice is not fed and we can let go of the gambler and give him back his
Dice's and have a good thing.
Right.
So this is what we will be doing here.
So we are able to find out if there is something wrong with a particular distribution using the goodness
of the.
So this is how we use the goodness of the test, the next what we will be checking about is the.
Best for these guys, quietist.
OK, so let us have a look at this one more example which we have.
OK, so this example contains two fifty six visual artists were surveyed to find out that Zodiac sign.
So we want to find out if the visual artists have even distribution across a particularly or across
these objects.
That is, there is no particular Zodiac sign which makes a good visual artist.
Right.
If there would be difference in the distribution, it would simply mean that a particular zodiac sign,
people will make good visual artists.
So we might really high in the particular Zodiac sign.
So what we do here is, again, we will have the categories as those 12 Zodiac signs, which we have,
what will be the degrees of freedom?
The degree of freedom will be 12 minus one.
These are the words of values, these are the expected values, the expected value is one hundred by
twelve, which is the expected value.
So how do we find out that the residual value we find all of those value minus expected value?
We take a whole square of this value and then divide it by the expected value, the desired, which
we get me some more of these and we get five point zero nine for.
Now, we can consider it a very small P value, if the P value is very small, then we will reject the
null hypothesis like this.
All the Zodiac signs are equal, and if the P value is very large, then the null hypothesis should
not be rejected.
Right.
So what do we have?
We have degrees of freedom 11 and the values five point zero nine.
Degree of Freedom 11.
And the value was five point.
Zero nine.
So here you can see that five point zero nine something here.
Right between zero point nine five zero nine zero point nine, which means that we cannot reject the
null hypothesis.
So.
We can easily see that all the Zodiac signs have equal possibility of having a talented visual artist
that is no particular Zodiac sign, which will create a better visual artist.
So this is what we gain from the goodness of the test.
The next thing which we will be learning about is these guys with this sort of independence, which
will be taken up in the next session.
Thank you.