Download presentation
Presentation is loading. Please wait.
1
Community &family medicine
Dr. Mayasah A. Sadiq FICM-FM
2
DATA QUALITATIVE QUANTITATIVE CHI SQUARE TEST T-TEST
3
Dr. Mayasah A. Sadiq FICMS-FM
The Chi-Square test Dr. Mayasah A. Sadiq FICMS-FM 2
4
Parametric and Nonparametric Tests
Introduce two non-parametric hypothesis tests using the chi-square statistic: the chi-square test for goodness of fit and the chi-square test for independence.
5
Parametric and Nonparametric Tests (cont.)
The term "non-parametric" refers to the fact that the chi‑square tests do not require assumptions about population parameters nor do they test hypotheses about population parameters.
6
Previous example of hypothesis test, such as the T test is a parametric test and includes assumptions about parameters and hypotheses about parameters.
7
Parametric and Nonparametric Tests (cont.)
The most obvious difference between the chi‑square tests and the other hypothesis tests we have considered (T test) is the nature of the data. For chi‑square, the data are frequencies rather than numerical scores.
8
For testing significance of patterns in qualitative data.
Chi-squared Tests For testing significance of patterns in qualitative data. Test statistic is based on counts that represent the number of items that fall in each category Test statistics measures the agreement between actual counts(observed) and expected counts assuming the null hypothesis
9
Chi square distribution
10
Applications of Chi-square test:
Goodness-of-fit The 2 x 2 chi-square test (contingency table, four fold table) The a x b chi-square test (r x c chi-square test)
11
The Chi-Square Test for Goodness-of-Fit
The chi-square test for goodness-of-fit uses frequency data from a sample to test hypotheses about the shape or proportions of a population. The data, called observed frequencies, simply count how many individuals from the sample are in each category.
12
The Chi-Square Test for Goodness-of-Fit (cont.)
The null hypothesis specifies the proportion of the population that should be in each category. The proportions from the null hypothesis are used to compute expected frequencies that describe how the sample would appear if it were in perfect agreement with the null hypothesis.
13
Figure 18.1 Distribution of eye colors for a sample of n = 40 individuals. The same frequency distribution is shown as a bar graph, as a table, and with the frequencies written in a series of boxes.
15
An Example Biased Coin? Observed Expected Frequency Frequency H T sum
19
Degree of freedom for goodness of fit
K-1(k=no.of groups ) 2-1=1 From the table for α 0.5= 3.841 Calc.Χ>tabulated There is signif. Differ. In proportion. There is association.
20
The Chi-Square Test for Independence
The second chi-square test, the chi-square test for independence, can be used and interpreted in two different ways: 1. Testing hypotheses about the relationship between two variables in a population, or(2×2) 2. Testing hypotheses about differences between proportions for two or more populations.(a×b)
21
The Chi-Square Test for Independence (cont.)
The data, called observed frequencies, simply show how many individuals from the sample are in each cell of the matrix. The null hypothesis for this test states that there is no relationship between the two variables; that is, the two variables are independent.
22
The Chi-Square Test for Independence (cont.)
Both chi-square tests use the same statistic. The calculation of the chi-square statistic requires two steps: 1. The null hypothesis is used to construct an idealized sample distribution of expected frequencies that describes how the sample would look if the data were in perfect agreement with the null hypothesis.
23
The Chi-Square Test for Independence (cont.)
For the goodness of fit test, the expected frequency for each category is obtained by expected frequency = fe = pn (p is the proportion from the null hypothesis and n is the size of the sample) For the test for independence, the expected frequency for each cell in the matrix is obtained by (row total)(column total) expected frequency = fe = ───────────────── n
24
Figure 18.4 For Example 18.1, the critical region begins at a chi-square value of 7.81.
25
The Chi-Square Test for Independence (cont.)
2. A chi-square statistic is computed to measure the amount of discrepancy between the ideal sample (expected frequencies from H0) and the actual sample data (the observed frequencies = fo). A large discrepancy results in a large value for chi-square and indicates that the data do not fit the null hypothesis and the hypothesis should be rejected.
26
The Chi-Square Test for Independence (cont.)
The calculation of chi-square is the same for all chi-square tests:
27
Chi Square FORMULA:
28
2nd application
29
Result not deaf. deaf total Operator A 100 900 1000 B 60 440 500 total 160 1340 1500
30
Operator Result A B deaf not deaf. total 100 900 1000 60 440 500 160 1340 1500 Total number of items=1500 Total number of defective items=160
32
Operator Result A B def not def. total 100 900 1000 60 440 500 160 1340 1500 Expected deaf from Operator A = 1000 * 160/1500 = 106.7 (expected not deaf= =893.3) Expected deaf from Operator B = 500 * 160/1500 = 53.3
33
Result Operator A B def not def. total 100 900 1000 60 440 500 160 1340 1500 Operator Expected A B def not def. total 106.7 893.3 53.3 446.7
36
r x c contingency tables
SA A NO D SD Gr Gr Gr
38
Degree of freedom The d.f depends on subgroup and sample size.
( k-1 ) , or (r-1 ) (c-1)
39
degrees of freedom = (R –1)(C – 1)
R = number of rows C = number of columns
40
For testing significance of patterns in qualitative data.
Chi-squared Test summary For testing significance of patterns in qualitative data. Test statistic is based on counts that represent the number of items that fall in each category Test statistics measures the agreement between actual counts(observed) and expected counts assuming the null hypothesis
41
Chi-Square (χ2) Any number squared is a positive number
Therefore, area under the curve starts at 0 and goes to infinity To be statistically significant, needs to be in the upper 5% (α = .05) Compares observed frequency to what we expected 9/14/2010
42
2 Test of Independence Solution
H0: No Relationship Ha: Relationship = .05 df = (2 - 1)(2 - 1) = 1 Critical Value(s): Test Statistic: Decision: Conclusion: = .05 47
43
If your calculated chi-square value is greater than the critical value calculated, you“reject the null hypothesis.” If your chi-square value is less than the critical value, you“fail to reject” the null hypothesis
44
Yates Correction When we apply 2x2 chi-square test and one of the expected cells was <5 or when we apply axb chi-square test and one of the expected cells was <2, or when the grand total is <40 we have to apply Yates' correction formula;
45
YATES = ∑ -------------------------------------
46
When 2x2 chi-square test have a zero cell (one of the four cells is zero) we can not apply chi-square test because we have what is called a complete dependence criteria. But for axb chi-square test and one of the cells is zero when can not apply the test unless we do proper categorization to get rid of the zero cell.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.