What Is a Chi-Square Statistic?
A chi-square (χ2)statistic is a prove that measures how expectations compare to actual observed data (or model results). The data used in calculating a chi-square statistic must be unspecific, raw, mutually exclusive, drawn from independent variables, and drawn from a large enough sample. For example, the fruits of tossing a coin 100 times meet these criteria.
The Formula for Chi-Square Is
χc2=∑Ei(Oi−Ei)2where:c=Degrees of freedomO=Observed value(s)
What Does a Chi-Square Statistic Rake You?
There are two main kinds of chi-square tests: the test of independence, which asks a question of relationship, such as, “Is there a relationship between gender and SAT records?”; and the goodness-of-fit test, which asks something like “If a coin is tossed 100 times, will it arrive up heads 50 times and tails 50 times?”
For these tests,
Example of a Chi-Squared Test
Imagine a irregularly poll was taken across 2,000 different voters, both male and female. The people who responded were classified by their gender and whether they were republican, democrat, or disregarding. Imagine a grid with the columns labeled republican, democrat, and independent, and two rows labeled male and female. Presume the data from the 2,000 respondents is as follows:
The first step to calculate the chi squared statistic is to find the expected frequencies. These are suited for each “cell” in the grid. Since there are two categories of gender and three categories of political view, there are six unqualified expected frequencies. The formula for the expected frequency is:
E(r,c)=nn(r)×c(r)where:r=Row in queryc=Column in question
In this example, the expected frequencies are:
E(1,1)=2,000900×800=360E(1,2)=2,000900×800=360E(1,3)=2,000200×800=80E(2,1)=2,000900×1,200=540E(2,2)=2,000900×1,200=540
Next, these are second-hand values to calculate the chi squared statistic using the following formula:
Chi-squared=∑E(r,c)[O(r,c)−E(r,c)]2where:
In this example, the expression for each observed value is:
O(1,1)=360400−3602=4.44O(1,2)=360300×3602=10O(1,3)=80100−802=5O(2,1)=540500−5402=2.96O(2,2)=540600−5402=6.67
The chi-squared statistic then matchings the sum of these value, or 32.41. We can then look at a chi-squared statistic table to see, given the degrees of freedom in our set-up, if the conclusion is statistically significant or not.