1 / 30

Comparison of proportions 比例的比較 -Part I

Comparison of proportions 比例的比較 -Part I. Instructor: 李奕慧 yihwei@mail.tcu.edu.tw. Lecture Overview. Cross Tabulations 2 X 2 tables R XC tables Chi-square Test for Independence Chi-square Test for Trend. Cross Tabulation and Chi-square test for independence:

Download Presentation

Comparison of proportions 比例的比較 -Part I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Comparison of proportions 比例的比較-Part I Instructor: 李奕慧 yihwei@mail.tcu.edu.tw

  2. Lecture Overview • Cross Tabulations • 2 X 2 tables • R XC tables • Chi-square Test for Independence • Chi-square Test for Trend

  3. Cross Tabulation and Chi-square test for independence: To Explore the Association Between Two Categorical Variables, 例:機車騎士戴安全帽與否是否與發生車禍時頭部受傷的機率有關?

  4. Data Input Data Type : Measure Scale: 連續變數 Nominal/Ordinal: 類別變數 Value: 定義類別變數的項目, 0=“no”, 1=“yes”. Helmet.sav dataset

  5. Observed frequencies: O11, O12, O21, O22

  6. Under H0, Expected frequencies: E11, E12, E21, E22 E11 = 200 x P(戴安全帽) x P(頭部受傷) = 200 x (100/200) x (74/200) = 37 E12 = 200 x P(戴安全帽) x P(頭部沒受傷) = 200 x (100/200) x (126/200) = 63=100-37

  7. Expected frequencies: E11, E12, E21, E22

  8. Chi-square test (2-test) for independence

  9. 大樣本用:Pearson Chi-square Test 小樣本用:Fisher’s Exact Test

  10. Row variable: Injury Column variable: Helmet 數學上的慣例:Row *Column

  11. SPSS Menu Analyze > Descriptive Statistics > Crosstabs

  12. Another way to input data Data >Weight Cases Helmet2.sav dataset

  13. 當樣本數很小時,或E11, E12, E21, E22小於5 Chi-square 檢定不夠準確,必須使用 Yate’s continuity correction test, or Fisher’s exact test

  14. Summary results: 2-test = 3.846, P-value = 0.050 Yate’s corrected 2-test = 2.345 , P-value = 0.126 Fisher’s exact test, P-value = 0.086

  15. Table Example in Research Article Values are number of study subjects (percentage). P-value is derived from Fisher’s exact test.

  16. Helmet3.sav

  17. R x C Tables • Row variable with r levels • Column variable with c levels • Test for the independence between Row and Column variables • Using Chi-square test with df=(r-1)x(c-1)

  18. Test H0: proportions of each type of death certificates are identical in the two hospitals (There is no association between hospital type and death certificate status)

  19. Expected counts under H0: independence Erc=(nr x nc)/575

  20. Chi-square test for no association (independence) between Hospital type and death certificate status with df=(2-1)(3-1)=2, P<0.001 Reject H0 and conclude that there is an association between hospital type and death certificate status. It appears (from data) that Hospital A contains a larger proportion of death certificates that are incorrect and required recoding than Hospital B.

  21. Hospital.sav

  22. Chi-square test for trend • If one or both variables are ordinal, then chi-square test for trend is appropriate. • Chi-square test for trend also known as Mantel-Haenszel test for trend. • In R x 2 Tables, • H0: p1=p2=…=pc versus • Ha: p1<p2<…<pc (an increasing trend) or Ha:p1>p2>…>pc (a decreasing trend)

  23. Examples for chi-square test for trend H0: P65-69=P70-74=P75+ Ha: P65-69>P70-74>P75+ or P65-69<P70-74<P75+ MI之後,抽煙病人接受戒煙諮商的比例,隨著年齡增加有下降的趨勢

  24. Smoking.sav

  25. Exercise Am J Public Health. 2004 Oct;94(10):1768-74

  26. Categorical data: depression= (yes or no) • H0: proportion of subjects with depression in women = proportion of subjects with depression in men • H0: pf = pm • Ha: proportion of subjects with depression in women is different from proportion of subjects with depression in men • Ha: pf pm

  27. Depression.sav

  28. Exercise:Comparison among age groups • H0: proportions of subjects with depression are the same among the three age groups. H0: p75-79 = p80-84 = p85+ • Ha: proportions of subjects with depression are different among the three age groups. (test for independence) • Ha: depression prevalence is increasing in older age groups. (test for trend)

  29. Practice! Practice! Practice! Thank you !

More Related