Learning Statistics /Pearson's chi-squared test (χ2)

1 view
Skip to first unread message

sayanyein

unread,
Mar 6, 2019, 1:01:39 PM3/6/19
to Mandalay University Family 2006

Pearson's chi-squared test (χ2) is a statistical test applied to sets of categorical data to evaluate how likely it is that any observed difference between the sets arose by chance. It is suitable for unpaired data from large samples.[1] It is the most widely used of many chi-squared tests (e.g., Yates, likelihood ratio, portmanteau test in time series, etc.) – statistical procedures whose results are evaluated by reference to the chi-squared distribution. Its properties were first investigated by Karl Pearson in 1900.[2] In contexts where it is important to improve a distinction between the test statistic and its distribution, names similar to Pearson χ-squared test or statistic are used.

It tests a null hypothesis stating that the frequency distribution of certain events observed in a sample is consistent with a particular theoretical distribution. The events considered must be mutually exclusive and have total probability 1. A common case for this is where the events each cover an outcome of a categorical variable. A simple example is the hypothesis that an ordinary six-sided die is "fair" (i. e., all six outcomes are equally likely to occur.)

Definition

Pearson's chi-squared test is used to assess three types of comparison: goodness of fit, homogeneity, and independence.

  • A test of goodness of fit establishes whether an observed frequency distribution differs from a theoretical distribution.
  • A test of homogeneity compares the distribution of counts for two or more groups using the same categorical variable (e.g. choice of activity—college, military, employment, travel—of graduates of a high school reported a year after graduation, sorted by graduation year, to see if number of graduates choosing a given activity has changed from class to class, or from decade to decade).[3]
  • A test of independence assesses whether unpaired observations on two variables, expressed in a contingency table, are independent of each other (e.g. polling responses from people of different nationalities to see if one's nationality is related to the response).

For all three tests, the computational procedure includes the following steps:

  1. Calculate the chi-squared test statistic, χ 2 {\displaystyle \chi ^{2}} , which resembles a normalized sum of squared deviations between observed and theoretical frequencies (see below).
  2. Determine the degrees of freedom, df, of that statistic. For a test of goodness-of-fit, this is essentially the number of categories reduced by the number of parameters of the fitted distribution. For test of homogeneity, df = (Rows - 1)×(Cols - 1), where Rows corresponds to the number of categories (i.e. rows in the associated contingency table), and Cols corresponds the number of independent groups (i.e. columns in the associated contingency table).[3] For test of independence, df = (Rows - 1)×(Cols - 1), where in this case, Rows corresponds to number of categories in one variable, and Cols corresponds to number of categories in the second variable.[3]
  3. Select a desired level of confidence (significance level, p-value or alpha level) for the result of the test.
  4. Compare χ 2 {\displaystyle \chi ^{2}} to the critical value from the chi-squared distribution with df degrees of freedom and the selected confidence level (one-sided since the test is only one direction, i.e. is the test value greater than the critical value?), which in many cases gives a good approximation of the distribution of χ 2 {\displaystyle \chi ^{2}} .
  5. Accept or reject the null hypothesis that the observed frequency distribution is the same as the theoretical distribution based on whether the test statistic exceeds the critical value of χ 2 {\displaystyle \chi ^{2}} . If the test statistic exceeds the critical value of χ 2 {\displaystyle \chi ^{2}} , the null hypothesis ( H 0 {\displaystyle H_{0}} = there is no difference between the distributions) can be rejected, and the alternative hypothesis ( H 1 {\displaystyle H_{1}} = there is a difference between the distributions) can be accepted, both with the selected level of confidence.
Reply all
Reply to author
Forward
0 new messages