Chi square test and its types

19
Chi square test and its variations Dr. S. A. Rizwan, M.D. Public Health Specialist SBCM, Joint Program – Riyadh Ministry of Health, Kingdom of Saudi Arabia

Transcript of Chi square test and its types

Page 1: Chi square test and its types

Chi square test and its variations Dr. S. A. Rizwan, M.D.

Public Health Specialist

SBCM, Joint Program – Riyadh

Ministry of Health, Kingdom of Saudi Arabia

Page 2: Chi square test and its types

Learning objectives

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Describe the conditions in which this test is used • Describe the assumptions for this test • Describe the steps involved in calculating this test • Interpret the test result • Describe the types of this test χ2

Page 3: Chi square test and its types

Introduction

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Chi square test, also called Pearson’s chi square test

• First investigated by Karl Pearson in 1900

Page 4: Chi square test and its types

Applications of chi square test

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Goodness of fit - whether an observed frequency distribution differs from a theoretical distribution.

• Homogeneity - compares the distribution of counts for two or more groups using the same categorical variable

• Independence (most commonly used) - assesses whether unpaired observations on two variables are independent of each other

• Others

Page 5: Chi square test and its types

Applications – example 1

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• A 6-sided die is thrown 60 times. The number of times it lands with 1, 2, 3, 4, 5 and 6 face up is 5, 8, 9, 8, 10 and 20, respectively. Is the die biased, according to the Pearson's chi-squared test at a significance level of 95%

Page 6: Chi square test and its types

Applications – example 2

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• A random sample of 100 people has been drawn from a population in which men and women are equal in frequency, the observed number of men and women would be compared to the theoretical frequencies of 50 men and 50 women

Page 7: Chi square test and its types

Applications – example 2.1

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• A random sample of 100 persons been drawn from men and 100 persons from among women. They were asked about smoking habits. Compare the percentage of smokers among men and women.

Men Women Total

Smoker 40 20 60

Non-smoker 60 80 140

Total 100 100 200

Page 8: Chi square test and its types

Applications – example 3

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• A city of 1 million residents with four neighborhoods: A, B, C, and D. A random sample of 650 residents of the city is taken and their occupation is recorded as "white collar", "blue collar", or "no collar". The null hypothesis is that each person's neighborhood of residence is independent of the person's occupational classification

Page 9: Chi square test and its types

Types / variations

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Test for goodness of fit • Test for Homogeneity • Test of Independence • Cochran–Mantel–Haenszel test • Test for Trend

* Advanced learning: What is Yate’s correction?

Page 10: Chi square test and its types

Assumptions

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Simple random sample • Data in the cells should be frequencies, or counts

of cases • Categories of the variables are mutually exclusive • Study groups must be independent • Value of cell expecteds should be 5 or more in at

least 80% of the cells • No cell should have an expected of less than one

Page 11: Chi square test and its types

Steps in Chi square test for independence

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Recall the general steps

1. Null hypothesis 2. Alternative hypothesis 3. Level of significance 4. Test statistic 5. Critical value 6. Decision & interpretation

Page 12: Chi square test and its types

Steps in Chi square test for independence

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Draw the contingency table

Page 13: Chi square test and its types

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Calculate totals for each row and column

Steps in Chi square test for independence

Page 14: Chi square test and its types

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Calculated expected frequencies for each cell

Steps in Chi square test for independence

Page 15: Chi square test and its types

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Calculate Chi square value using the formula and degree of freedom

Steps in Chi square test for independence

Page 16: Chi square test and its types

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Look at a chi-square table, for a 0.05 level of significance & 2 df, what is the critical chi-square value and make the conclusion

Steps in Chi square test for independence

Page 17: Chi square test and its types

Summary

Demystifying statistics! – Lecture 7 SBCM, Joint Program – Riyadh

• With computers, these tests are performed easily

• There are many situations where chi square is incorrectly applied

• It is important to know when to and when not to use them

Page 18: Chi square test and its types

Take home messages

Demystifying statistics! – Lecture 8 SBCM, Joint Program – Riyadh

• Chi square is one of the most used statistical tests

• Remember the different types of tests and their applications

• Remember the assumptions and always check for violations before interpreting the results

Page 19: Chi square test and its types

Thank you! Email your queries to [email protected]