Fluorite | Level 6

## Reproduction of an example from the book of Agresti

Good morning,

On page 183 of the book "Introduction to the Categorical Data Analysis, 2nd Edition" (2007), Agresti presents Table 6.8, stating explicitly "Table 6.8 shows output (from PROC LOGISTIC in SAS) for the ML fit of model (6.4)."

Could someone be so kind to provide me with the code with which I could reproduce this table?. Particularly the section "Deviance and Pearson Goodness-of-Fit Statistics".

To make your life easier, I am attaching a script with the data, so you don't have to rewrite it.

Thanks in advance and best regards,

Piotr Lewczuk

data party;
input g p y count;

datalines;
0 1 0 44
0 1 1 47
0 1 2 118
0 1 3 23
0 1 4 32
0 0 0 18
0 0 1 28
0 0 2 86
0 0 3 39
0 0 4 48
1 1 0 36
1 1 1 34
1 1 2 53
1 1 3 18
1 1 4 23
1 0 0 12
1 0 1 18
1 0 2 62
1 0 3 45
1 0 4 51
; run;

4 REPLIES 4
Meteorite | Level 14

## Re: Reproduction of an example from the book of Agresti

Welcome to the SAS community!

You can try this to get the desired output:

``````proc logistic data=party;
class p (ref='0') y / param=reference;
freq count;
model y = p / link=logit equalslopes=p aggregate scale=none lackfit;
run;
``````

NB:

- equalslope allows only 1 estimate for the parameter p instead of 4

Hope this helps,

Best,

Fluorite | Level 6

## Re: Reproduction of an example from the book of Agresti

Thank you very much! Very helpful.

Regards,

Piotr Lewczuk

## Re: Reproduction of an example from the book of Agresti

@ed_sas_member's code reproduces all statistics in that Table 6.8, so it is a solution.

The same output can also be created with the code below:

``````proc logistic data=party;
class p(ref='0' param=ref);
freq count;
model y=p / aggregate scale=n;
run;``````
Fluorite | Level 6

## Re: Reproduction of an example from the book of Agresti

Indeed; since this example focuses on cumulative logit, perhaps the code below is even more explicit:

proc logistic data=party;
freq count;
model y(ref="4") = p /link=clogit aggregate scale=none;
run;