Download presentation
Published byLeona Dalton Modified over 7 years ago
1
Megan Templin, MPH, M.S. H. James Norton, PhD Dickson Advanced Analytics Research Division Carolinas Healthcare System
2
Chi-square Test
3
Jeopardy: Statistics for 100
The test that should be performed to answer: …“The general problem may be stated as follows: having given the number of instances in which things are both thus and so, in which they are thus but not so, in which they are so but not thus, and in which they are neither thus nor so, it is required …to determine the quantitative relativity between the thusness and the soness of the things.”
4
Jeopardy: Statistics for 100
What is the chi-square test? Thus Not Thus So Not So Bulletin of the Philosophical Society of Washington, (1888).
5
Jeopardy: Statistics for 800
The book this is a quote from:…“Grown-ups love figures. When you tell them you have made a new friend, they never ask you about essential matters. They never ask you, “What games does he love best? …Instead they demand, “How old is he? How much money does his father make?” Only from these figures do they think they have learned anything about him.”
6
Jeopardy: Statistics for 800
What is “The Little Prince?”
7
What is the chi-square test?
A statistical test used to compare groups on the percentage with a condition or outcome Also known as contingency table
8
Assumptions of Random sample Adequate sample size
Frequency data Random sample Adequate sample size Adequate expected cell counts Independent observations
9
Chi-square hypothesis
Null hypothesis: There is no difference in the proportions of the two treatment groups There is not an association between the two variables The outcome (survival) is INDEPENDENT of the treatment group H0: P1=P2 Alternative hypothesis: There is a difference in the proportions of the two treatment groups There is an association between the two variables The outcome (survival) is DEPENDENT on the treatment group (the 2 variables are not independent and therefore survival depends on which group you are in) HA:P1≠P2
10
Chi-square Example Suppose we are interested in studying a drug that we hope will increase the 2-year survival of patients following an M.I. We have 46 patients in each of 2 groups (treatment vs. placebo). Furthermore, suppose we lose to follow-up one patient in the experimental drug group.
11
Example (continued) Null hypothesis: H0: P1=P2
There is no difference in the proportions of the two treatment groups. The outcome (survival) is INDEPENDENT of treatment group Alternative hypothesis: HA:P1≠P2 There is a difference in the proportions of the two treatment groups; The outcome (survival) is DEPENDENT of the treatment group (survival and treatment are not independent of each other and therefore survival depends on which treatment group you are in)
12
Example (continued) Outcome 91 Drug Experimental Drug Control Survived
38 29 67 Died 7 17 24 45 46 Marginal totals 91 Grand Total Marginal totals
13
Example (continued) In the literature we could report this data as:
% surviving at 2 years with experimental drug = = 84% % surviving at 2 years with control = = 63%
14
Example (continued) 67 24 45 46 91 Drug Outcome 38 29 7 17 Exp. Drug
Control 38 29 7 17 Outcome 67 Survived 24 Died 45 46 91 The 4 cells of this table are OBSERVED values We must calculate what is known as EXPECTED values one would expect if the 2 variables were INDEPENDENT
15
Example (continued) 67 24 45 46 91 Drug Outcome 38 29 7 17 Exp. Drug
Control 38 29 7 17 Outcome 67 Survived 24 Died 45 46 91 To calculate the critical value you need to first calculate the degrees of freedom and the expected value for each cell. Expected values: Chi-square: = # in row x # in column total number
16
Example (continued)
17
Chi-Square Table
18
Chi-Square Table 5.024 6.635 So, 0.025 > p > 0.01
Computers give exact calculation, p=0.02 Conclude: The percentage of people who survived at 2 years was significantly higher in the experimental drug group (84%) than in the control group (63%).
19
Pediatric Trauma Center
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Injury Type Adult Trauma Center Pediatric Trauma Center Total N Blunt 3,175 1,676 4,851 Penetrating 618 321 939 Burn 82 66 148 Asphyxia 12 26 38 3,887 2,089 5,976 The null hypothesis says that there is not an association between injury type and trauma center (they are independent) The alternative hypothesis says there is an association between injury type and trauma center (they are dependent)
20
Pediatric Trauma Center Pediatric Trauma Center
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Injury Type Adult Trauma Center Pediatric Trauma Center Total Column % N Blunt 81.7% 80.2% 4,851 Penetrating 15.9% 15.3% 939 Burn 2.1% 3.1% 148 Asphyxia 0.3% 1.2% 38 3,887 2,089 5,976 Injury Type Adult Trauma Center Pediatric Trauma Center Total Row % N Blunt 65.5% 34.5% 4,851 Penetrating 65.8% 34.2% 939 Burn 55.4% 44.6% 148 Asphyxia 31.6% 68.4% 38 3,887 2,089 5,976
21
Pediatric Trauma Center
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Injury Type Adult Trauma Center Pediatric Trauma Center Total N Blunt 3,175 1,676 4,851 Penetrating 618 321 939 Burn 82 66 148 Asphyxia 12 26 38 3,887 2,089 5,976 Degree of Freedom: df = (# rows - 1) x (# columns - 1) Injury Type: =3 Type of Center: =1 df = 3 x 1 = 3
22
Pediatric Trauma Center
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Injury Type Adult Trauma Center Pediatric Trauma Center Total N Blunt 3,175 1,676 4,851 Penetrating 618 321 939 Burn 82 66 148 Asphyxia 12 26 38 3,887 2,089 5,976 Expected values: = # in row x # in column total number
23
Pediatric Trauma Center
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Injury Type Adult Trauma Center Pediatric Trauma Center Total N Blunt 3,175 1,676 4,851 Penetrating 618 321 939 Burn 82 66 148 Asphyxia 12 26 38 3,887 2,089 5,976 Expected values: = # in row x # in column total number Blunt injury – Adult Trauma Center: = 4,851 x 3, = 3,155.3 5,976 Observed n = 3,175 Expected n = 3,155.3
24
Pediatric Trauma Center
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Injury Type Adult Trauma Center Pediatric Trauma Center Total N Blunt 3,175 1,676 4,851 Penetrating 618 321 939 Burn 82 66 148 Asphyxia 12 26 38 3,887 2,089 5,976 Expected values: = # in row x # in column total number Burn injury – Peds. Trauma Center: = x 2, = 51.7 5,976 Observed n = 66 Expected n = 51.7
25
Pediatric Trauma Center
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Observed and Expected Values Injury Type Adult Trauma Center Pediatric Trauma Center Total N Blunt 3,175 (3155.3) 1,676 (1695.7) 4,851 Penetrating 618 (610.8) 321 (328.2) 939 Burn 82 (96.3) 66 (51.7) 148 Asphyxia 12 (24.7) 26 (13.3) 38 3,887 2,089 5,976
26
Walther, A. E. , MD; Pritts, T. A. , MD, PhD; Falcone, R. A
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Chi-Square Calculation
27
Walther, A. E. , MD; Pritts, T. A. , MD, PhD; Falcone, R. A
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Degrees of freedom = 3 Critical value = 25.33
28
Walther, A. E. , MD; Pritts, T. A. , MD, PhD; Falcone, R. A
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Degrees of freedom = 3 Critical value = 25.33
29
Walther, A. E. , MD; Pritts, T. A. , MD, PhD; Falcone, R. A
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Degrees of freedom = 3 Critical value = 25.33 Chi-square value of and 3 degrees of freedom is greater than Therefore, the p-value is less than For adolescent patients, there is a statistically significant difference in the distribution of injury types between adult and pediatric trauma centers
30
Our calculated significance: P-value: < 0.005
Walther, A. E., MD; Pritts, T. A., MD, PhD; Falcone, R. A., MD, MPH; Hanseman, D. J., PhD; Robinson, B. R. H., MD. (2014). Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. Journal of Trauma Acute Care Surgery, vol. 77 (n. 1), pp Our calculated significance: P-value: < 0.005 Therefore, reject the null hypothesis and state there is an association between type of trauma center and injury type.
31
Our calculations: Df: 3 Critical value: 25.33 P-value: < 0.005
Teen Trauma without the Drama: Outcomes of Adolescents Treated at Ohio Adult versus Pediatric Trauma Centers. SAS Output: Our calculations: Df: 3 Critical value: P-value: < 0.005
32
Key points The further apart observed values are from expected values then the larger the chi-square value. This goes back to our null hypothesis that the two things we are studying are independent…in other words, the less independent two things are, the further apart the observed and expected values will be. If the chi-square equals 0, then proportions perfectly match the hypothesis. When the chi-square value is large, it leads to a smaller p-value and rejection of the null hypothesis. You need a larger sample size for categorical comparisons compared to the sample size need for numeric comparisons (example, age in categories vs. numeric age) Tests ASSOCIATION, NOT CAUSE & EFFECT!! If the two variables being compared are dependent (paired) samples, McNemar’s test should be used. If the grand total is <40 (some say<20) or if the expected value of any cell is <5 (some say <1), then use Fisher’s Exact test.
33
Sample Size Calculations for Chi-Square
To calculate the number of patients needed in an experimental and a control group for a given probability of obtaining a significant result (two-sided test), you need to know (or educated guess): Smaller proportion Difference in proportions Alpha Power From: Career Medicine – Holland, JF,& Frei E.I. Chapter 8
34
Sample Size Example 1 Suppose the failure rate of a drug is 40%. You would like to decrease that rate to 20% with a new treatment and design a study comparing the two drugs. Using the table, how many subjects are needed in each group for an alpha level of 0.05 and power of 0.80?
35
Sample Size Example 1 Suppose the failure rate of a drug is 40%. You would like to decrease that rate to 20% with a new treatment and design a study comparing the two drugs. Using the table, how many subjects are needed in each group for an alpha level of 0.05 and power of 0.80? Smaller proportion: 20% 2. Difference in proportions: 20% 3. Alpha: .05 4. Power: .80
36
Sample Size Example 1 Suppose the failure rate of a drug is 40%. You would like to decrease that rate to 20% with a new treatment and design a study comparing the two drugs. Using the table, how many subjects are needed in each group for an alpha level of 0.05 and power of 0.80? Smaller proportion: 20% 2. Difference in proportions: 20% 3. Alpha: .05 4. Power: .80 Answer: At least 80 per group
37
Sample Size Example 2 Suppose the failure rate of a drug is 40%. You would like to decrease that rate to 20% with a new treatment and design a study comparing the two drugs. Using the table, how many subjects are needed in each group for an alpha level of 0.05 and power of 0.90?
38
Sample Size Example 2 Suppose the failure rate of a drug is 40%. You would like to decrease that rate to 20% with a new treatment and design a study comparing the two drugs. Using the table, how many subjects are needed in each group for an alpha level of 0.05 and power of 0.90? Smaller proportion: 20% 2. Difference in proportions: 20% 3. Alpha: .05 4. Power: .90
39
Sample Size Example 2 Suppose the failure rate of a drug is 40%. You would like to decrease that rate to 20% with a new treatment and design a study comparing the two drugs. Using the table, how many subjects are needed in each group for an alpha level of 0.05 and power of 0.90? Smaller proportion: 20% 2. Difference in proportions: 20% 3. Alpha: .05 4. Power: .90 Answer: At least 105 per group
40
Sample Size Example 3 Suppose the failure rate of a drug is 40%. You would like to decrease that rate to 30% with a new treatment and design a study comparing the two drugs. Using the table, how many subjects are needed in each group for an alpha level of 0.05 and power of 0.80?
41
Sample Size Example 3 Suppose the failure rate of a drug is 40%. You would like to decrease that rate to 30% with a new treatment and design a study comparing the two drugs. Using the table, how many subjects are needed in each group for an alpha level of 0.05 and power of 0.80? Smaller proportion: 30% 2. Difference in proportions: 10% 3. Alpha: .05 4. Power: .80
42
Sample Size Example 3 Suppose the failure rate of a drug is 40%. You would like to decrease that rate to 30% with a new treatment and design a study comparing the two drugs. Using the table, how many subjects are needed in each group for an alpha level of 0.05 and power of 0.80? Smaller proportion: 30% 2. Difference in proportions: 10% 3. Alpha: .05 4. Power: .80 Answer: At least 360 per group
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.