220 likes | 353 Views
Modeling Ordinal Associations. Section 9.4. Roanna Gee. 1991 General Social Survey. National Opinion 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
E N D
Modeling Ordinal Associations Section 9.4 Roanna Gee
1991 General Social Survey National Opinion 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
Independence Model log mij = + i + j X Y mij = Expected count = Mean log cell count i = Adjustment for Row i j = Adjustment for Column j X Y Degrees of Freedom n = (r – 1)(c – 1)
Sample Calculation of mij log†m23 = log (row total) + log(column total) – log(table total) = log 93 + log 324 – log 926 ≈ 3.48 so m23 ≈ exp(3.48) ≈ 32.5 or P(AB) • n = P(A) P(B) • n = (93/926)(324/926)(926) m23 can be calculated as (93)(324)/(926) ≈ 32.5 † log means natural logarithm
Calculate m and li X m is the mean of the logs of the expected all the cell counts. m = (log 42.4 + log 51.2 + . . . + log 111.4)/16 = 3.8836 X i is the adjustment to m for row i—its mean less m. l2 = (log 16.0 + log 19.3 + log 32.5 + log 25.2)/4 – 3.8836 = -0.7734 j is the adjustment to m for column j. l3 = 0.3692 X Y Y
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 m. We lose 3 degrees for the li ’s. (Since Sli = 0, l4 = – l1 – l2 – l3.) We also lose 3 degrees for the lj ’s. X X X X X X Y n = 16 – 1 – 3 – 3 = 9 n = rc – 1 – (r – 1) – (c – 1) = (r – 1)(c – 1)
Pearson Residuals = -0.8 A standardized Pearson residual that exceeds 2 or 3 in absolute value indicates a lack of fit.
SAS Code Independence Model data sex; input premar birth u v count @@; linlin = u*v ; datalines; 1 4 1 4 38 1 3 1 3 60 1 2 1 2 68 1 1 1 1 81 2 4 2 4 14 2 3 2 3 29 2 2 2 2 26 2 1 2 1 24 3 4 3 4 42 3 3 3 3 74 3 2 3 2 41 3 1 3 1 18 4 4 4 4 157 4 3 4 3 161 4 2 4 2 57 4 1 4 1 36 ; procgenmod; class premar birth; model count = premar birth / dist=poi link=log; run;
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
Saturated Model: log mij = + i + j + ij Y X XY ij = Adjustment for Cell ij XY Degrees of Freedom n = 0 23 = log n23 – m – l2 – l3 = log 29 – 3.8836 – (-0.7734) – .3692 = 2.0728 XY Y X
Linear-by-Linear Model X Y log mij = + i + j + uivj : linear-by linear association ui: row scores vj: column scores The Linear-by-Linear model adds a parameter so we lose a degree of freedom: n = (r – 1)(c – 1) – 1 = 8
SAS Code Linear-by-Linear Model data sex; input premar birth u v count @@; linlin = u*v ; datalines; 1 4 1 4 38 1 3 1 3 60 1 2 1 2 68 1 1 1 1 81 2 4 2 4 14 2 3 2 3 29 2 2 2 2 26 2 1 2 1 24 3 4 3 4 42 3 3 3 3 74 3 2 3 2 41 3 1 3 1 18 4 4 4 4 157 4 3 4 3 161 4 2 4 2 57 4 1 4 1 36 ; procgenmod; class premar birth; model count = premar birth linlin / dist=poi link=log; run;
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
Sample Calculation in theLinear-by-Linear Model log m23 = m + l2 + l3 + bu2v3 = 0.4735 + 1.7537 + 1.1551 + 0.2858(2)(3) = 3.4511 m23 = exp(3.4511) = 31.5 Y X 18
Odds Ratio and Example:
Saddle Movie