13.11.2012 Views

Introduction to Categorical Data Analysis

Introduction to Categorical Data Analysis

Introduction to Categorical Data Analysis

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

342 APPENDIX A: SOFTWARE FOR CATEGORICAL DATA ANALYSIS<br />

Table A.16. SAS Code for GLMM Modelling of Opinion in Table 10.4<br />

data new;<br />

input sex poor single any count;<br />

datalines;<br />

1 1 1 1 342<br />

...<br />

2 0 0 0 457<br />

;<br />

data new; set new;<br />

sex = sex-1; case = _n_;<br />

q1=1; q2=0; resp = poor; output;<br />

q1=0; q2=1; resp = single; output;<br />

q1=0; q2=0; resp = any; output;<br />

drop poor single any;<br />

proc nlmixed qpoints = 50;<br />

parms alpha=0 beta1=.8 beta2=.3 gamma=0 sigma=8.6;<br />

eta = u + alpha + beta1∗q1 + beta2∗q2 + gamma∗sex;<br />

p = exp(eta)/(1 + exp(eta));<br />

model resp ˜ binary(p);<br />

ramdom u ˜ normal(0,sigma∗sigma) subject = case;<br />

replicate count;

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

Saved successfully!

Ooh no, something went wrong!