22
1 Modeling Ordinal Associations Section 9.4 Roanna Gee

1 Modeling Ordinal Associations Section 9.4 Roanna Gee

  • View
    224

  • Download
    2

Embed Size (px)

Citation preview

Page 1: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

1

Modeling Ordinal Associations

Section 9.4

Roanna Gee

Page 2: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

2

National Opinion Survey

1991 General Social Survey

Opinions were asked about a man and a woman having sexualrelations 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

Page 3: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

3

Opinions on Premarital Sex and Teenage Birth Control

Premarital Sex

i (row)

Teenage Birth Control j (column)

ij i

Strongly Disagree Disagree Agree Strongly 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)-1.0

(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

159 192 324 251 926

Page 4: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

4

log ij = + i + j

Independence ModelX Y

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)

Page 5: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

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)

Page 6: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

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

Page 7: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

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 X X

Y

= 16 – 1 – 3 – 3 = 9

= rc – 1 – (r – 1) – (c – 1) = (r – 1)(c – 1)

Page 8: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

8

Data and Independence Model

Premarital Sex

i (row)

Teenage Birth Control j (column)

ij i

Strongly Disagree Disagree Agree Strongly Agree

Always Wrong81

(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 All36

(70.6)

57(85.2)

161(143.8)

157(111.4) 411

ij j

159 192 324 251 926

Page 9: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

9

eij nij ˆ ij

ˆ ij (1 pi)(1 p j )

Pearson Residuals

= -0.8

A standardized Pearson residual that exceeds 2 or 3 in absolute value indicates a lack of fit.

e23 29 32.5

32.5 1 93

926

1 324

926

Page 10: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

10

Data and Pearson Residuals

Premarital Sex

i (row)

Teenage Birth Control j (column)

ij i

Strongly Disagree Disagree Agree Strongly Agree

Always Wrong817.6

683.1

60-4.1

38-4.8 247

Almost Always

Wrong

242.3

261.8

29-0.8

14-2.8 93

Wrong Only

Sometimes

18-2.7

411.0

742.2

42-1.0 175

Not Wrong at All36

-6.157

-4.61612.4

1576.8 411

ij j

159 192 324 251 926

Page 11: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

11

SAS Code Independence Modeldata sex;input premar birth u v count @@; linlin = u*v ;datalines;1 4 1 4 381 3 1 3 601 2 1 2 681 1 1 1 812 4 2 4 142 3 2 3 292 2 2 2 262 1 2 1 243 4 3 4 423 3 3 3 743 2 3 2 413 1 3 1 184 4 4 4 1574 3 4 3 1614 2 4 2 574 1 4 1 36;proc genmod; class premar birth; model count = premar birth / dist=poi link=log;run;

Page 12: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

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

Page 13: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

13

Flat Plane

Page 14: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

14

log ij = + i + j + ij

Saturated Model:

X Y

ij = Adjustment for Cell ijXY

Degrees of Freedom = 0

XY

23 = log n23 – – 2 – 3

= log 29 – 3.8836 – -0.7734) – .3692

= 2.0728

XY X Y

Page 15: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

15

log ij = + i + j + uivj

:linear-by linear associationui : row scoresvj : column scores

Linear-by-Linear Model

X Y

The Linear-by-Linear model adds a parameter so we lose a degree of freedom:

= (r – 1)(c – 1) – 1 = 8

Page 16: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

16

SAS Code Linear-by-Linear Modeldata sex;input premar birth u v count @@; linlin = u*v ;datalines;1 4 1 4 381 3 1 3 601 2 1 2 681 1 1 1 812 4 2 4 142 3 2 3 292 2 2 2 262 1 2 1 243 4 3 4 423 3 3 3 743 2 3 2 413 1 3 1 184 4 4 4 1574 3 4 3 1614 2 4 2 574 1 4 1 36;proc genmod; class premar birth; model count = premar birth linlin / dist=poi link=log;run;

Page 17: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

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

Page 18: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

18

Sample Calculation in the Linear-by-Linear Model

log 23 = + 2 + 3 + u2v3

= 0.4735 + 1.7537 + 1.1551 + 0.2858(2)(3)

= 3.4511

23 = exp(3.4511) = 31.5

X Y

18

Page 19: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

19

Data and Linear-by-Linear Model

Premarital Sex

i (row)

Teenage Birth Control j (column)

ij i

Strongly Disagree Disagree Agree Strongly Agree

Always Wrong81

(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 All36

(33.0)57

(65.1)161

(157.4)157

(155.5) 411

ij j

159 192 324 251 926

19

Page 20: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

20

Constant Odds Ratio by Uniform Association Model

Page 21: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

21

Odds Ratio

logabcd

adcb

uc ua vd vb

7283

7382

e 11

72

73

e 82

83

72

82

e 73

83

and

Example:

Page 22: 1 Modeling Ordinal Associations Section 9.4 Roanna Gee

22

Saddle

Movie