澳洲幸运5开奖号码历史查询

Chi-Square (χ2) Statistic: What It Is, Examples, How and When to Use the Test

Chi-Square Statistic

Paige McLaughlin / Investopedia

Definition

Chi-square is a ꩲstatistical measurement that shows how well a model fits the observed data.

What Is a Chi-Square (χ2) Statistic?

A chi-square (χ2) statistic is a test that compares observed data to the model and measures its fit. The data used in calculating🐽 a chi-square statistic must be random, raw, mutually exclusive, drawn from independent variables, and derived from a sufficiently large sample. For example, the results of tossing a fair🍬 coin meet these criteria.

Chi-sqꦜuare tests are often used to test hypotheses. The chi-square statistic compares the size of any discrepancies between the expected results and the actual results, given 💯the size of the sample and the number of variables in the relationship.

For these tests, degrees of freedom are used to determine if a certain 澳洲幸运5开奖号码历史查询:null hypothesis can be rejected based on the total number of variables and samples within the experiment. As with any statis💎tic, the larger the sample size, the more reliable the results.

Key Takeaways

  • Chi-square is useful for analyzing such differences in categorical variables, especially those nominal in nature.
  • χ2 depends on the size of the difference between actual and observed values, the degrees of freedom, and the sample size.
  • χ2 can be used to test whether two variables are related or independent of each other.
  • It can also be used to test the goodness of fit between an observed distribution and a theoretical distribution of frequencies.

Formula for a Chi-Square (χ2) Statistic

 χ c 2 = ( O i E i )2 E i where: c = Degrees of freedom O = Observed value(s) \begin{aligned}&\chi^2_c = \sum \frac{(O_i - E_i)^2}{E_i} \\&\textbf{where:}\\&c=\text{Degrees of freedom}\\&O=\text{Observed value(s)}\\&E=\text{Expected value(s)}\end{aligned} χc2=Ei(OiEi)2where:c=Degrees of freedomO=Observed value(s)

What a Chi-Square (χ2) Statistic Can Tell You

There are two main kinds of chi-square tests that will provide different informa✨tion:

  • The test of independence, which asks a question of relationship, such as, “Is there a relationship between student gender and course choice?”
  • The goodness-of-fit test, which asks a theoretical question such as, “How well does the coin in my hand match a theoretically fair coin?”

Note

Chi-square anal💞ysis is applied to categorical variables and is especially useful when those variables are nominal (where order doesn’t matter, like marital status or genderꦫ).

Test of Independence

When considering student gender and course choice, a χ2 test for independence could be used. To do this test, the researcher would collect data on the two chosen variables (gender and courses picked) and then compare the frequencies at which male and female students select among the offered classes using the formula given above and a χ2 statistical table.

If there is no relationship between gender and course selection (that is if they are independent), then the actual frequencies at which male and female students select each offered course should be expected to be approximately equal, or conversely, the proportion of male and female students in any selected course should be approximately equal to the proportion of male and female students in the sample.

A χ2 test for independence can tell us how likely it is that random chance can explainꩲ any observed difference between the actual frequencies in the dܫata and these theoretical expectations.

In a test of independence, a company may want to evaluate🅘 whether its ✱new product, an herbal supplement that promises to give people an energy boost, is reaching the people who are most likely to be interested.

It is being 澳洲幸运5开奖号码历史查询:advertised on websites related to sports and fitness, on the assumption that active and health-conscious people are most likely🌠 to buy it. It does an extensive poll that is intended to evaluate interest in the product by demographic group. The poll suggests no correlation between interest in this product and the most health-conscious people.

Test of Goodness of Fit

χ2 provides a way to test how well a sample of data matches the (known or assumed) characteristics of the larger population that the sample is intended to represe🅠nt. This is kn🐻own as goodness of fit.

If the sample data does not fit the expected properties of the population💮 in which one is interested, then one would not want to use this sample to draw conclusions about the larger 💜population.

As an example of a test of 澳洲幸运5开奖号码历史查询:goodness of fit, a marketing professional is considering ౠlaunching a new product that the company believes will be irresistible to women over age 45. The company has conducted product testing panels of 500 𝄹potential product buyers.

The marketing professional has information about the age and gender of the test panels. This allows the construction of a chi-square test showing the 澳洲幸运5开奖号码历史查询:distribution by age and gender of the people who said they🥃 would buy the produc🍸t.

The result will show whether or not the likeliest buyer is a woman ꦐover 45. If the test shows that men over age 45 or women ages 18 to 44 are just as likely to buy the produꦓct, then the marketing professional will revise the advertising, promotion, and placement of the product to appeal to this wider group of customers.

Example of How🧜 to Use a C♏hi-Square (χ2) Statistic

For example, consider an imaginary coin with exactly a 50/50 chance of 澳洲幸运5开奖号码历史查询:landing heads or tails and a real coin that you toss 100 times. If this coin is fair, then it will also have an equal probability of landing on either side, and the expected result of tossing the coin 100 times is🐠 that heads will come up 50 times and tails will come up 50 times.

In this case, χ2 can tell us how well the actual results of 100 coin flips compare to the theoretical model 🅰that a fair coin will give 50/50 results. The actual toss could come up 50/50, or 60/40, or even 90/10.

The farther away the actual results of🦂 the 100 tosses are from 50/50, the less good the fit of this set of tosses is to the⛄ theoretical expectation of 50/50, and the more likely one might conclude that this coin is not actually a fair coin.

When to Use a Chi-Square (χ2) Test

A chi-square test is used to help determine if observe🐬d results are in line wit🅰h expected results and to rule out that observations are due to chance.

A chi-square test is appropriate for this when the data being analyzed is from a 澳洲幸运5开奖号码历史查询:random sample, and when the va♈riable in question is a categorical variable. A categorical vඣariable consists of selections such as type of car, race, educational attainment, male or female, or how much somebody likes a political candidate (from very much to very little).

These types of data are often collected via survey🍸 responses or questionnaires. Therefore, chi-square analysis is often most useful in analyzing this type of data.

How to Perform a Chi-Square (χ2) Test

These are the basic steps whether you are performing a goodness-of-fit test or 🎃a test of independence:

  • Create a table of the observed and expected frequencies.
  • Use the formula to calculate the chi-square value.
  • Find the critical chi-square value using a chi-square value table or 澳洲幸运5开奖号码历史查询:statistical software.
  • Determine whether the chi-square value or the critical value is the larger of the two.
  • Reject or accept the null hypothesis.

Limitations of a Chi-Square (χ2) Statistic

The chi-square test is s🎶ensitive to sample size. Relationships may appear to be significant when they aren’ไt, simply because a very large sample is used.

In addition, the chi-square test cannot establish whether one variable has a causal relationship with another. It can only establish whether two variables are related.

What Is a Chi-Square Test Used for?

Chi-square is a statistical test used to examine the differences between categorical variables from a random sample in order to judge the goodness of fit between expected and obser𒁃ved results.

Who Uses Chi-Square Analysis?

Since chi-square applies to categorical variables, it is most used by researche🌺rs who are studying survey response data. This type of research can range from demography to consumer and marketing research to political science and economics.

Is Chi-Square Analysis Used When the Independent Variable Is Nominal or Ordinal?

A nominal variable is a cate💟gorical variable that differs by quality, but whose numerical order could be irrelevant. For instance, asking somebody their favorite color would produce a nominal variable. Asking somebody’s age, on the other hand, would produce an ordinal set of data. Chi-square can be best applied to nominal data.

The Bottom Line

A chi-square statistic is used to measure the difference between the observed and expected frequencies of the outcomes of a set of variables. It can be helpful for analyzing differences in categorical variables, especially those nominal in nature. The two different types of chi-square tests—test of independence and test of goodness of fit—will answer different relational questions.

Take the Next Step to Invest
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.

Related Articles