Presentation is loading. Please wait.

Presentation is loading. Please wait.

THE CHI-SQUARE TEST BACKGROUND AND NEED OF THE TEST Data collected in the field of medicine is often qualitative. --- For example, the presence or absence.

Similar presentations


Presentation on theme: "THE CHI-SQUARE TEST BACKGROUND AND NEED OF THE TEST Data collected in the field of medicine is often qualitative. --- For example, the presence or absence."— Presentation transcript:

1 THE CHI-SQUARE TEST BACKGROUND AND NEED OF THE TEST Data collected in the field of medicine is often qualitative. --- For example, the presence or absence of a symptom, classification of pregnancy as ‘high risk’ or ‘non- high risk’, the degree of severity of a disease (mild, moderate, severe)

2 The measure computed in each instance is a proportion, corresponding to the mean in the case of quantitative data such as height, weight, BMI, serum cholesterol. Comparison between two or more proportions, and the test of significance employed for such purposes is called the “Chi-square test”

3 KARL PEARSON IN 1889, DEVISED AN INDEX OF DISPERSION OR TEST CRITERIOR DENOTED AS “CHI-SQUARE “. (  2 ). KARL PEARSON IN 1889, DEVISED AN INDEX OF DISPERSION OR TEST CRITERIOR DENOTED AS “CHI-SQUARE “. (  2 ).

4 Introduction  What is the  2 test?   2 is a non-parametric test of statistical significance for bivariate tabular analysis.  Any appropriately performed test of statistical significance lets you know that degree of confidence you can have in accepting or rejecting a hypothesis.

5 Introduction  What is the  2 test?  The hypothesis tested with chi square is whether or not two different samples are different enough in some characteristics or aspects of their behavior that we can generalize from our samples that the populations from which our samples are drawn are also different in the behavior or characteristic.

6 Introduction  What is the  2 test?  The  2 test is used to test a distribution observed in the field against another distribution determined by a null hypothesis.  Being a statistical test,  2 can be expressed as a formula. When written in mathematical notation the formula looks like this:

7 Chi- Square   ( o - e ) 2 e X = X 2 = Figure for Each Cell

8 reject H o if  2 >  2. ,df where df = (r-1)(c-1)  2 = ∑ (O - E) 2 E 3.E is the expected frequency ^ E =E =E =E = ^ (total of all cells) total of row in which the cell lies total of column in which the cell lies 1.The summation is over all cells of the contingency table consisting of r rows and c columns 2.O is the observed frequency 4.The degrees of freedom are df = (r-1)(c-1)

9 Chi-square test 1. 2. 3. 4. Test statistics

10 Introduction  When using the chi square test, the researcher needs a clear idea of what is being investigate.  It is customary to define the object of the research by writing an hypothesis.  Chi square is then used to either prove or disprove the hypothesis.

11 Hypothesis  The hypothesis is the most important part of a research project. It states exactly what the researcher is trying to establish. It must be written in a clear and concise way so that other people can easily understand the aims of the research project.

12 Chi-square test Purpose To find out whether the association between two categorical variables are statistically significant Null Hypothesis There is no association between two variables

13 Requirements  Prior to using the chi square test, there are certain requirements that must be met.  The data must be in the form of frequencies counted in each of a set of categories. Percentages cannot be used.  The total number observed must be exceed 20.

14 Requirements  The expected frequency under the H 0 hypothesis in any one fraction must not normally be less than 5.  All the observations must be independent of each other. In other words, one observation must not have an influence upon another observation.

15 APPLICATION OF CHI-SQUARE TEST  TESTING INDEPENDCNE (or ASSOCATION)  TESTING FOR HOMOGENEITY  TESTING OF GOODNESS-OF- FIT

16 Chi-square test  Objective : Smoking is a risk factor for MI  Null Hypothesis: Smoking does not cause MI D (MI)D-(No MI)Total Smokers292150 Non-smokers163450 Total4555100

17 Chi-SquareChi-Square E O 29 E O 21 E O 16 E O 34 MINon-MI Smoker Non-Smoker

18 Chi-SquareChi-Square E O 29 E O 21 E O 16 E O 34 MINon-MI Smoker Non-smoker 50 5545100

19 Estimating the Expected Frequencies E =E =E =E = ^ (row total for this cell)(column total for this cell) n Classification 1 Classification 2 1 2 3 4c r 123 C1C1C1C1 C2C2C2C2 C3C3C3C3 C4C4C4C4 CcCcCcCc R1R1R1R1 R2R2R2R2 R3R3R3R3 RrRrRrRr E =E =E =E = ^ R2C3R2C3nnR2C3R2C3nnn

20 Chi-SquareChi-Square E O 29 E O 21 E O 16 E O 34 MINon-MI Smoker Non-smoker 50 5545100 50 X 45 100 22.5 = 22.5

21 Chi-SquareChi-Square E O 29 E O 21 E O 16 E O 34 AloneOthers Males Females 50 5545100 22.527.5 22.527.5

22 Chi-SquareChi-Square  Degrees of Freedom df = (r-1) (c-1) = (2-1) (2-1) =1  Critical Value (Table A.6) = 3.84  Critical Value (Table A.6) = 3.84  X 2 = 6.84  Calculated value(6.84) is greater than critical (table) value (3.84) at 0.05 level with 1 d.f.f  Hence we reject our Ho and conclude that there is highly statistically significant association between smoking and MI.

23 Chi square table dfά = 0.05 ά = 0.01 ά = 0.001 13.846.6410.83 25.999.2113.82 37.8211.3516.27 49.4913.2818.47 511.0715.0920.52 612.5916.8122.46 714.0718.4824.32 815.5120.0926.13 916.9221.6727.88 1018.3123.2129.59

24 Age Gender 45Total Male 60 (60)20 (30)40 (30)120 Female 40 (40)30 (20)10 (20)80 Total1005050200 Chi- square test Find out whether the gender is equally distributed among each age group

25 Test for Homogeneity (Similarity) To test similarity between frequency distribution or group. It is used in assessing the similarity between non-responders and responders in any survey Age (yrs)RespondersNon-respondersTotal <2076 (82)20 (14)96 20 – 29288 (289)50 (49)338 30-39312 (310)51 (53)363 40-49187 (185)30 (32)217 >5077 (73) 9 (13) 86 Total9401601100

26 What to do when we have a paired samples and both the exposure and outcome variables are qualitative variables (Binary). What to do when we have a paired samples and both the exposure and outcome variables are qualitative variables (Binary).

27 Problem  A researcher has done a matched case- control study of endometrial cancer (cases) and exposure to conjugated estrogens (exposed).  In the study cases were individually matched 1:1 to a non-cancer hospital- based control, based on age, race, date of admission, and hospital.

28 Data

29  can’t use a chi-squared test - observations are not independent - they’re paired.  we must present the 2 x 2 table differently  each cell should contain a count of the number of pairs with certain criteria, with the columns and rows respectively referring to each of the subjects in the matched pair  the information in the standard 2 x 2 table used for unmatched studies is insufficient because it doesn’t say who is in which pair - ignoring the matching

30 Data

31 McNemar’s test Situation:  Two paired binary variables that form a particular type of 2 x 2 table  e.g. matched case-control study or cross-over trial

32 We construct a matched 2 x 2 table:

33 The odds ratio is: f/g The test is: Formula Compare this to the  2 distribution on 1 df

34 P <0.001, Odds Ratio = 43/7 = 6.1 p 1 - p 2 = (55/183) – (19/183) = 0.197 (20%) s.e.(p 1 - p 2 ) = 0.036 95% CI: 0.12 to 0.27 (or 12% to 27%)

35  Degrees of Freedom df = (r-1) (c-1) = (2-1) (2-1) =1  Critical Value (Table A.6) = 3.84  Critical Value (Table A.6) = 3.84  X 2 = 25.92  Calculated value(25.92) is greater than critical (table) value (3.84) at 0.05 level with 1 d.f.f  Hence we reject our Ho and conclude that there is highly statistically significant association between Endometrial cancer and Estrogens.

36

37 | Controls | Cases | Exposed Unexposed | Total -----------------+------------------------+------------ Exposed | 12 43 | 55 Unexposed | 7 121 | 128 -----------------+------------------------+------------ Total | 19 164 | 183 McNemar's chi2(1) = 25.92 Prob > chi2 = 0.0000 Exact McNemar significance probability = 0.0000 Proportion with factor Cases.3005464 Controls.1038251 [95% Conf. Interval] --------- -------------------- difference.1967213.1210924.2723502 ratio 2.894737 1.885462 4.444269 rel. diff..2195122.1448549.2941695 odds ratio 6.142857 2.739772 16.18458 (exact) Stata Output


Download ppt "THE CHI-SQUARE TEST BACKGROUND AND NEED OF THE TEST Data collected in the field of medicine is often qualitative. --- For example, the presence or absence."

Similar presentations


Ads by Google