1 / 25

Crosstabulation

Crosstabulation. Measuring Association To what extent are two variables, X and Y , related? Begin with the idea of statistical independence. Room Temperature Mean Exam Score 72 75 85 75 98 75.

beck
Download Presentation

Crosstabulation

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. Crosstabulation

  2. Measuring AssociationTo what extent are two variables, X and Y, related?Begin with the idea ofstatistical independence

  3. Room Temperature Mean Exam Score 72 75 85 75 98 75

  4. Room Temperature Mean Exam Score 72 75 85 70 98 65

  5. An ideal measure of association would have a value of 0.0 when there is no association and a value of ±1.0 when there is perfect (direct or inverse) association. |————|————| -1.0 0.0 +1.0

  6. Unfortunately, χ2 doesn’t have this property. Instead, it varies as follows: |———————0.0 +

  7. Twenty high school seniors on a survey were asked two questions: (1) whether they were male or female; and (2) whether they planned to attend a four-year college immediately upon graduation. The separate answers were: Male = 11, Female = 9Yes = 6, No = 14

  8. GenderMale FemaleTotalCollegeYes 4 2 6Plans?No 7 7 14Total 11 9 20

  9. Gender (Expected Frequencies)Male FemaleTotalCollegeYes 3.3 2.7 6Plans?No 7.7 6.3 14Total11 9 20

  10. Generalizing this approach, the algorithm is: Here, "f-hat" means expected frequency, and fi. and f.j are the appropriate row and column marginals. N, as always, is sample size.

  11. Cell1,1 4 3.3 -0.7 0.49 0.151,2 2 2.7 0.7 0.49 0.182,1 7 7.7 0.7 0.49 0.062,2 7 6.3 -0.7 0.49 0.08 ____  = 0.47

  12. Stated as an algorithm, this is the 2 statistic: In this example, 2 = 0.47

  13. Degrees of Freedom df = (R – 1)(C – 1)For a table with two rows and two columns, this would be:df = (2 – 1)(2 – 1)df = (1)(1)df = 1

  14. Using SAS to Produce Two-Way FrequencyDistributions and Statisticslibname mystuff 'a:\';libname library 'a:\';optionsformchar='|----|+|---+=|-/\< >*'ps=66 nodate nonumber;proc freq data=mystuff.marriage;tables church*married / expected all;title1 ‘Crosstabulation for Discrete Variables';run;

  15. Crosstabulation for Discrete Variables TABLE OF CHURCH BY MARRIED CHURCH MARRIED Frequency| Expected | Percent | Row Pct | Col Pct |Divorced|Married |Never |Separate|Widowed | Total ---------+--------+--------+--------+--------+--------+ Annually | 74 | 269 | 129 | 18 | 43 | 533 | 62.318 | 290.33 | 101.17 | 18.695 | 60.485 | | 5.09 | 18.50 | 8.87 | 1.24 | 2.96 | 36.66 | 13.88 | 50.47 | 24.20 | 3.38 | 8.07 | | 43.53 | 33.96 | 46.74 | 35.29 | 26.06 | ---------+--------+--------+--------+--------+--------+ Monthly | 30 | 149 | 50 | 10 | 26 | 265 | 30.983 | 144.35 | 50.303 | 9.295 | 30.072 | | 2.06 | 10.25 | 3.44 | 0.69 | 1.79 | 18.23 | 11.32 | 56.23 | 18.87 | 3.77 | 9.81 | | 17.65 | 18.81 | 18.12 | 19.61 | 15.76 | ---------+--------+--------+--------+--------+--------+ Never | 32 | 85 | 34 | 6 | 16 | 173 | 20.227 | 94.234 | 32.839 | 6.0681 | 19.632 | | 2.20 | 5.85 | 2.34 | 0.41 | 1.10 | 11.90 | 18.50 | 49.13 | 19.65 | 3.47 | 9.25 | | 18.82 | 10.73 | 12.32 | 11.76 | 9.70 | ---------+--------+--------+--------+--------+--------+ Weekly | 34 | 289 | 63 | 17 | 80 | 483 | 56.472 | 263.09 | 91.684 | 16.942 | 54.811 | | 2.34 | 19.88 | 4.33 | 1.17 | 5.50 | 33.22 | 7.04 | 59.83 | 13.04 | 3.52 | 16.56 | | 20.00 | 36.49 | 22.83 | 33.33 | 48.48 | ---------+--------+--------+--------+--------+--------+ Total 170 792 276 51 165 1454 11.69 54.47 18.98 3.51 11.35 100.00

  16. Crosstabulation for Discrete Variables STATISTICS FOR TABLE OF CHURCH BY MARRIED Statistic DF Value Prob ------------------------------------------------------Chi-Square 1257.792 0.000 Likelihood Ratio Chi-Square 12 57.806 0.000 Mantel-Haenszel Chi-Square 1 8.152 0.004 Phi Coefficient 0.199 Contingency Coefficient 0.196 Cramer's V 0.115 Statistic Value ASE ------------------------------------------------------ Gamma 0.052 0.033 Kendall's Tau-b 0.035 0.022 Stuart's Tau-c 0.031 0.020 Somers' D C|R 0.033 0.021 Somers' D R|C 0.037 0.024 Pearson Correlation 0.075 0.026 Spearman Correlation 0.041 0.026 Lambda Asymmetric C|R 0.000 0.000 Lambda Asymmetric R|C 0.062 0.027 Lambda Symmetric 0.036 0.016 Uncertainty Coefficient C|R 0.016 0.004 Uncertainty Coefficient R|C 0.015 0.004 Uncertainty Coefficient Symmetric 0.016 0.004 Sample Size = 1454

  17. Exercise CrosstabulationCompute the value of chi square (c2) and indicate the number of degrees of freedom (df) for the following two-way frequency distribution. Approval of Abortion Religious Identification Yes No TotalProtestant 709 197 906Catholic 275 87 362Jewish 26 0 26None 92 9 101Other 17 1 18Total 1,119 294 1,413

  18. =============================================================== ^^^^^fij fij (fij - fij) (fij - fij)2 (fij - fij)2/fij---------------------------------------------------------------709 275 26 92 17197 87 0 9 1---------------------------------------------------------------

  19. =============================================================== ^^^^^fij fij (fij - fij) (fij - fij)2 (fij - fij)2/fij---------------------------------------------------------------709 717.490 275 286.680 26 20.590 92 79.985 17 14.255197 188.510 87 75.321 0 5.410 9 21.015 1 3.745---------------------------------------------------------------

  20. =============================================================== ^^^^^fij fij (fij - fij) (fij - fij)2 (fij - fij)2/fij---------------------------------------------------------------709 717.490 8.490275 286.680 11.679 26 20.590 -5.410 92 79.985 -12.015 17 14.255 -2.745197 188.510 -8.490 87 75.321 -11.679 0 5.410 5.410 9 21.015 12.015 1 3.745 2.745---------------------------------------------------------------

  21. =============================================================== ^^^^^fij fij (fij - fij) (fij - fij)2 (fij - fij)2/fij---------------------------------------------------------------709 717.490 8.490 72.088275 286.680 11.679 136.409 26 20.590 -5.410 29.266 92 79.985 -12.015 144.357 17 14.255 -2.745 7.536197 188.510 -8.490 72.088 87 75.321 -11.679 136.409 0 5.410 5.410 29.266 9 21.015 12.015 144.357 1 3.745 2.745 7.536---------------------------------------------------------------

  22. =============================================================== ^^^^^fij fij (fij - fij) (fij - fij)2 (fij - fij)2/fij---------------------------------------------------------------709 717.490 8.490 72.088 0.100275 286.680 11.679 136.409 0.476 26 20.590 -5.410 29.266 1.421 92 79.985 -12.015 144.357 1.805 17 14.255 -2.745 7.536 0.529197 188.510 -8.490 72.088 0.382 87 75.321 -11.679 136.409 1.811 0 5.410 5.410 29.266 5.410 9 21.015 12.015 144.357 6.869 1 3.745 2.745 7.536 2.012--------------------------------------------------------------- = 20.816

  23. df = (R - 1)(C - 1) = (5 - 1)(2 - 1) = (4)(1) = 4

More Related