Presentation is loading. Please wait.

Presentation is loading. Please wait.

 Test for Qualitative variables Chi Square Test Dr. Asif Rehman.

Similar presentations


Presentation on theme: " Test for Qualitative variables Chi Square Test Dr. Asif Rehman."— Presentation transcript:

1  Test for Qualitative variables Chi Square Test Dr. Asif Rehman

2 Outline  Types of Variables  Quantitative Data Assessment (parametric)  Descriptive assessment  T-test  Qualitative Data Assessment (Non parametric)  Descriptive Assessment  Chi Square test(Fisher Exact test)

3 Types of Data  Quantitative data or numerical data  Qualitative or Categorical data  Nominal Data(unordered, Do not represent any amount)  Sex (male,female)  Marital status (Married, Unmarried)  Blood group (O, A, AB, B)  Color of eyes (blue, green, brown,Black)  Nationality of a person (Pakistani, American, Turkish)  Ordinal data(ordered)  Measurement of height (tall, medium, short )  Degree of pain (mild, Moderate, severe)  Size of garment (large, medium,small )

4 Chi square test are done when;  Chi square test is used when both variables are measured on a nominal scale  It can be applied to interval or ratio data that have been categorized in to a small number of groups  It assumes that the observations are randomly sampled from the population  All observations are independent (an individual can appear only once in a table and there are no overlapping categories)

5 Categorical data assessment  Chi Square test (X 2 ) Compares observed and expected frequencies.  This test is applied to compare two or more than two proportions to test whether there is significant association between two are not  It is non parametric test, but is included in traditional methods of parametric tests

6 Chi Square test  The chi-square test is always testing what scientists call the Null Hypothesis, which states that there is no significant difference between the expected and observed result.  For estimating how closely an observed distribution matches an expected distribution  For estimating whether two random variables are independent.

7 Conducting Chi-Square Analysis 1) Make a hypothesis based on your basic research question 2) Determine the expected frequencies 3) Create a table with observed frequencies, expected frequencies, and chi-square values using the formula: (O - E) 2 E 4) Find the degrees of freedom: (C - 1)( R - 1) 5) Find the chi-square statistic in the Chi-Square Distribution table 6) If chi-square statistic > your calculated chi-square value, you do not reject your null hypothesis and vice versa.

8 Example To see the prophylactic value of Chloroquine, a study was conducted on 3540 persons. Out of 606 persons, who were given Chloroquine prophylactically, only 19 contracted malaria. Among those who were not given prophylactic treatment 193 contracted malaria. Comment on prophylactic value of Chloroquine.

9 Descriptive frequencies Total study population(n)= 3540 Chloroquine given=606 1. developed malaria=19 2. Did not developed malaria=587 Chloroquine not given=2934 1. Contracted malaria=193 2. Did not contract malaria=2741

10 2x2 contingency table Contracted malaria Did not contract malaria Total Chloroquine given 19587606 Chloroquine not given 19327412934 Total2123328n=3540

11  Null Hypothesis (H 0 )  Chloroquine has no role in prevention of malaria. At the end we have to reject or Accept the hypothesis

12 Calculation of expected values  E= Row total x Column total/Grand total = RT x CT/GT  E 1 = 606 x 212/3540 = 36  E 2 = 606 x 3328/3540 = 570  E 3 = 2934 x 212/3540 = 176  E 4 = 2934 x 3328/3540 = 2758

13 2x2 contingency table Contracted malariaDid not contract malaria Total Chloroquine givena (36)b (570) Chloroquine not givenc (176)d (2758) Total Expected  E= Row total x Column total/Grand total = RT x CT/GT  E 1 = 606 x 212/3540 = 36  E 2 = 606 x 3328/3540 = 570  E 3 = 2934 x 212/3540 = 176  E 4 = 2934 x 3328/3540 = 2758

14 2x2 contingency table Contracted malariaDid not contract malaria Total Chloroquine given19587606 Chloroquine not given19327412934 Total2123328n=3540 Contracted malariaDid not contract malaria Total Chloroquine given36570 Chloroquine not given1762758 Total Observed Expected

15 Calculation of x 2 value Observed value (O) Expected value (E) O-E(O-E) 2 (O-E) 2 /E O 1 =19E 1 =36-172898.02 O 2 =587E 2 = 570+172890.50 O 3 =193E 3 = 176+172891.64 O 4 =2741E 4 = 2758-172890.10 0∑=10.26

16 Calculation of degree of freedom Degree of freedom = (R - 1) x (C - 1) = (Rows-1) x (Column-1) = (2 - 1) x (2 - 1) = 1

17 Calculation of degree of freedom Degree of freedom = 1 Level of significance = 5% (0.05) Value = 3.84

18 Chi Square Table

19 Interpretation of results by consulting X 2 Table  Table value of X 2 with 1 degree of freedom, at the significance level of 5% (0.05) is 3.84  Our calculated value of X 2 is 10.26. which is more than table value of 3.84  So we will reject the null hypothesis and will say that chloroquine does have the prophylactic role in malaria and P < 0.05.  (the probability of occurrence of difference between two groups of persons only due to chance is <0.05 or 5%.

20 Exercise Suppose we have two vaccines A and B for the prevention of Measles and we have to decide which vaccine is more effective to be included in National program. We applied vaccine A to 100 children and 20 of them later developed infection. We applied vaccine B in another 100 children and 15 developed infection. Apparently vaccine be is better than A. 1. State your Null Hypothesis and Alternate Hypothesis 2. Make 2 x 2 table 3. Calculate chi square test 4. Interpret the results

21 THANK YOU


Download ppt " Test for Qualitative variables Chi Square Test Dr. Asif Rehman."

Similar presentations


Ads by Google