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 data 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 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 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 represent this is known 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 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 buyers of the product 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 distribution by age and gender of the people who said they would buy the product 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 product 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 chi square 2 statisticfor example consider an imaginary coin with exactly a 50 50 chance of 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 