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;
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,
Thank you very much! Very helpful.
Regards,
Piotr Lewczuk
Hi @PiotrLewczuk,
@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;
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;
Thanks for your support, anyway!
regards,
P. Lewczuk
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.