13.11.2012 Views

Introduction to Categorical Data Analysis

Introduction to Categorical Data Analysis

Introduction to Categorical Data Analysis

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 7: LOGLINEAR MODELS FOR CONTINGENCY TABLES 337<br />

PROC GENMOD can fit the proportional odds version of cumulative logit models<br />

using the DIST=MULTINOMIAL and LINK=CLOGIT options. Table A.7 fits<br />

it <strong>to</strong> Table 6.9. When the number of response categories exceeds two, by default<br />

PROC LOGISTIC fits this model. It also gives a score test of the proportional odds<br />

assumption of identical effect parameters for each cutpoint.<br />

Table A.7. SAS Code for Cumulative Logit Model with Mental Impairment <strong>Data</strong><br />

of Table 6.9<br />

data impair;<br />

input mental ses life;<br />

datalines;<br />

1 1 1<br />

....<br />

4 0 9<br />

;<br />

proc genmod ;<br />

model mental = life ses / dist=multinomial link=clogit lrci type3;<br />

proc logistic;<br />

model mental = life ses;<br />

One can fit adjacent-categories logit models in SAS by fitting equivalent baselinecategory<br />

logit models (e.g., see Table A.12 in the Appendix in Agresti, 2002). With<br />

the CMH option, PROC FREQ provides the generalized CMH tests of conditional<br />

independence. The statistic for the “general association” alternative treats X and Y as<br />

nominal, the statistic for the “row mean scores differ” alternative treats X as nominal<br />

and Y as ordinal, and the statistic for the “nonzero correlation” alternative treats X<br />

and Y as ordinal.<br />

CHAPTER 7: LOGLINEAR MODELS FOR CONTINGENCY TABLES<br />

Table A.8 uses GENMOD <strong>to</strong> fit model (AC, AM, CM) <strong>to</strong> Table 7.3. Table A.9 uses<br />

GENMOD <strong>to</strong> fit the linear-by-linear association model (7.11) <strong>to</strong> Table 7.15 (with<br />

column scores 1,2,4,5). The defined variable “assoc” represents the cross-product of<br />

row and column scores, which has β parameter as coefficient in model (7.11).<br />

Table A.8. SAS Code for Fitting Loglinear Models <strong>to</strong> Drug Survey <strong>Data</strong> of Table 7.3<br />

data drugs;<br />

input a c m count ©©;<br />

datalines;<br />

1 1 1 911 1 1 2 538 1 2 1 44 1 2 2 456<br />

2 1 1 3 2 1 2 43 2 2 1 2 2 2 2 279<br />

;<br />

proc genmod; class a c m;<br />

model count = a c m a∗m a∗c c∗m / dist=poi link=log lrci type3 obstats;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!