Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Modeling Ordinal Associations Section 9.4 Roanna Gee.

Similar presentations


Presentation on theme: "1 Modeling Ordinal Associations Section 9.4 Roanna Gee."— Presentation transcript:

1 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

2 2 National Opinion Survey 1991 General Social Survey Opinions were asked about a man and a woman having sexual relations before marriage.  Always Wrong  Almost Always  Wrong Only Sometimes  Not Wrong At All Opinions were also asked whether methods of birth control should be available to teenagers between the ages of 14 and 16.  Strongly Disagree  Disagree  Agree  Strongly Agree

3 3 Opinions on Premarital Sex and Teenage Birth Control Premarital Sex  i (row) Teenage Birth Control  j (column)   ij i Strongly DisagreeDisagreeAgreeStrongly Agree Always Wrong 81 (42.4) 7.6 (80.9) 68 (51.2) 3.1 (67.6) 60 (86.4) -4.1 (69.4) 38 (67.0) -4.8 (29.1) 247 Almost Always Wrong 24 (16.0) 2.3 (20.8) 26 (19.3) 1.8 (23.1) 29 (32.5) -0.8 (31.5) 14 (25.2) -2.8 (17.6) 93 Wrong Only Sometimes 18 (30.1) -2.7 (24.4) 41 (36.3) 1.0 (36.1) 74 (61.2) 2.2 (65.7) 42 (47.4) (48.8) 175 Not Wrong at All 36 (70.6) -6.1 (33.0) 57 (85.2) -4.6 (65.1) 161 (143.8) 2.4 (157.4) 157 (111.4) 6.8 (155.5) 411   ij j 159192324251926

4 4 log  ij =  + i + j Independence Model XY  ij =Expected count  =Mean log cell count i =Adjustment for Row i j =Adjustment for Column j X Y Degrees of Freedom = (r – 1)(c – 1)

5 5 Sample Calculation of  ij log †  23 = log (row total) + log(column total) – log(table total) = log 93 + log 324 – log 926 ≈ 3.48 so  23 ≈ exp(3.48) ≈ 32.5 or † log means natural logarithm  23 can be calculated as (93)(324)/(926) ≈ 32.5 P(A  B) n = P(A) P(B) n = (93/926)(324/926)(926)

6 6 Calculate  and i  is the mean of the logs of the expected all the cell counts.  = (log 42.4 + log 51.2 +... + log 111.4)/16 = 3.8836 i is the adjustment to  for row i—its mean less . 2 = (log 16.0 + log 19.3 + log 32.5 + log 25.2)/4 – 3.8836 = -0.7734 j is the adjustment to  for column j. 3 = 0.3692 X X Y X Y

7 7 Degrees of Freedom There are 4 rows and 4 columns giving us a total of 16 cells and therefore 16 degrees of freedom. For each parameter we add to the model, we lose one degree of freedom. We lose one degree for . We lose 3 degrees for the i ’s. (Since  i = 0, 4 = – 1 – 2 – 3.) We also lose 3 degrees for the j ’s. X X X X XX Y = 16 – 1 – 3 – 3 = 9 = rc – 1 – (r – 1) – (c – 1) = (r – 1)(c – 1)

8 8 Data and Independence Model Premarital Sex  i (row) Teenage Birth Control  j (column)   ij i Strongly DisagreeDisagreeAgreeStrongly Agree Always Wrong 81 (42.4) 68 (51.2) 60 (86.4) 38 (67.0) 247 Almost Always Wrong 24 (16.0) 26 (19.3) 29 (32.5) 14 (25.2) 93 Wrong Only Sometimes 18 (30.1) 41 (36.3) 74 (61.2) 42 (47.4) 175 Not Wrong at All 36 (70.6) 57 (85.2) 161 (143.8) 157 (111.4) 411   ij j 159192324251926

9 9 Pearson Residuals = -0.8 A standardized Pearson residual that exceeds 2 or 3 in absolute value indicates a lack of fit.

10 10 Data and Pearson Residuals Premarital Sex  i (row) Teenage Birth Control  j (column)   ij i Strongly DisagreeDisagreeAgreeStrongly Agree Always Wrong 81 7.6 68 3.1 60 -4.1 38 -4.8 247 Almost Always Wrong 24 2.3 26 1.8 29 -0.8 14 -2.8 93 Wrong Only Sometimes 18 -2.7 41 1.0 74 2.2 42 175 Not Wrong at All 36 -6.1 57 -4.6 161 2.4 157 6.8 411   ij j 159192324251926

11 11 SAS Code Independence Model data sex; input premar birth u v count @@; linlin = u*v ; datalines; 141438 131360 121268 111181 242414 232329 222226 212124 343442 333374 323241 313118 4444157 4343161 424257 414136 ; proc genmod; class premar birth; model count = premar birth / dist=poi link=log; run;

12 12 SAS Output Independence Model Criteria For Assessing Goodness Of Fit Criterion DF Value Value/DF Deviance 9 127.6529 14.1837 Scaled Deviance 9 127.6529 14.1837 Pearson Chi-Square 9 128.6836 14.2982 Scaled Pearson X2 9 128.6836 14.2982 Log Likelihood 2983.6850 Algorithm converged. Analysis Of Parameter Estimates Standard Wald 95% Confidence Chi- Parameter DF Estimate Error Limits Square Pr > ChiSq Intercept 1 4.7132 0.0731 4.5700 4.8564 4162.07 <.0001 premar 1 1 -0.5092 0.0805 -0.6670 -0.3514 40.00 <.0001 premar 2 1 -1.4860 0.1148 -1.7111 -1.2609 167.47 <.0001 premar 3 1 -0.8538 0.0903 -1.0307 -0.6769 89.48 <.0001 premar 4 0 0.0000 0.0000 0.0000 0.0000.. birth 1 1 -0.4565 0.1014 -0.6552 -0.2579 20.29 <.0001 birth 2 1 -0.2680 0.0959 -0.4559 -0.0800 7.81 0.0052 birth 3 1 0.2553 0.0841 0.0905 0.4201 9.22 0.0024 birth 4 0 0.0000 0.0000 0.0000 0.0000.. Scale 0 1.0000 0.0000 1.0000 1.0000

13 13 Flat Plane

14 14 log  ij =  + i + j + ij Saturated Model: X Y ij =Adjustment for Cell ij XY Degrees of Freedom = 0 XY 23 = log n 23 –  – 2 – 3 = log 29 – 3.8836 –  -0.7734) –.3692 = 2.0728 XY X Y

15 15 log  ij =  + i + j +  u i v j  :linear-by linear association u i :row scores v j :column scores Linear-by-Linear Model XY The Linear-by-Linear model adds a parameter so we lose a degree of freedom: = (r – 1)(c – 1) – 1 = 8

16 16 SAS Code Linear-by-Linear Model data sex; input premar birth u v count @@; linlin = u*v ; datalines; 141438 131360 121268 111181 242414 232329 222226 212124 343442 333374 323241 313118 4444157 4343161 424257 414136 ; proc genmod; class premar birth; model count = premar birth linlin / dist=poi link=log; run;

17 17 SAS Output Linear by Linear Model Criteria For Assessing Goodness Of Fit Criterion DF Value Value/DF Deviance 8 11.5337 1.4417 Scaled Deviance 8 11.5337 1.4417 Pearson Chi-Square 8 11.5085 1.4386 Scaled Pearson X2 8 11.5085 1.4386 Log Likelihood 3041.7446 Algorithm converged. Analysis Of Parameter Estimates Standard Wald 95% Confidence Chi- Parameter DF Estimate Error Limits Square Pr > ChiSq Intercept 1 0.4735 0.4339 -0.3769 1.3239 1.19 0.2751 premar 1 1 1.7537 0.2343 1.2944 2.2129 56.01 <.0001 premar 2 1 0.1077 0.1988 -0.2820 0.4974 0.29 0.5880 premar 3 1 -0.0163 0.1264 -0.2641 0.2314 0.02 0.8972 premar 4 0 0.0000 0.0000 0.0000 0.0000.. birth 1 1 1.8797 0.2491 1.3914 2.3679 56.94 <.0001 birth 2 1 1.4156 0.1996 1.0243 1.8068 50.29 <.0001 birth 3 1 1.1551 0.1291 0.9021 1.4082 80.07 <.0001 birth 4 0 0.0000 0.0000 0.0000 0.0000.. linlin 1 0.2858 0.0282 0.2305 0.3412 102.46 <.0001 Scale 0 1.0000 0.0000 1.0000 1.0000

18 18 Sample Calculation in the Linear-by-Linear Model log  23 =  + 2 + 3 +  u 2 v 3 = 0.4735 + 1.7537 + 1.1551 + 0.2858(2)(3) = 3.4511  23 = exp(3.4511) = 31.5 X Y 18

19 19 Data and Linear-by-Linear Model Premarital Sex  i (row) Teenage Birth Control  j (column)   ij i Strongly DisagreeDisagreeAgreeStrongly Agree Always Wrong 81 (80.9) 68 (67.6) 60 (69.4) 38 (29.1) 247 Almost Always Wrong 24 (20.8) 26 (23.1) 29 (31.5) 14 (17.6) 93 Wrong Only Sometimes 18 (24.4) 41 (36.1) 74 (65.7) 42 (48.8) 175 Not Wrong at All 36 (33.0) 57 (65.1) 161 (157.4) 157 (155.5) 411   ij j 159192324251926 19

20 20 Constant Odds Ratio by Uniform Association Model

21 21 Odds Ratio and Example:

22 22 Saddle Movie


Download ppt "1 Modeling Ordinal Associations Section 9.4 Roanna Gee."

Similar presentations


Ads by Google