BookmarkSubscribeRSS Feed
KKAY
Obsidian | Level 7

I read a paper which introduced the the proc genmod to build the partial proportional odds model. I copy the code and run. It is OK .

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
data ppom;
input id y x1 x2@@;
cards;
1 2 0 1 17 2 1 0 33 1 1 0
2 1 0 1 18 0 0 0 34 0 1 0
3 2 0 0 19 0 0 1 35 2 0 1
4 1 1 1 20 0 0 1 36 1 0 0
5 2 0 1 21 3 1 1 37 3 1 1
6 2 1 1 22 3 1 1 38 2 0 0
7 0 0 0 23 1 1 0 39 2 0 0
8 2 0 1 24 1 1 1 40 2 0 1
9 0 0 1 25 0 0 1 41 2 0 1
10 1 0 1 26 3 0 0 42 2 0 1
11 1 1 1 27 2 0 1 43 0 0 1
12 2 0 1 28 2 0 0 44 2 1 1
13 2 0 1 29 2 0 1 45 2 1 1
14 2 0 0 30 1 1 1 46 1 0 1
15 2 0 1 31 3 1 0 47 1 1 1
16 3 1 0 32 2 0 1 48 3 0 0
;
data ppom2;
set ppom;
yy=(y=3); logit=3;output;
yy=(y ge 2);logit=2; output;
yy=(y ge 1);logit=1;output;
run;

proc genmod desc;
class id logit;
model yy=x1 x2 logit logit*x1/link=logit dist=bin type3;
repeated subject=id/type=un;
run;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But if I changed the few numbers, it showed there are errors. 

 

ERROR: Error in computing the variance function.
ERROR: Error in parameter estimate covariance computation.
ERROR: Error in estimation routine.

 

Why? The errors did not always come. But it did. For example I changed the y=0 when id=33 as following

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

data ppom;
set ppom;
if id=33 then y=0;
run;
data ppom2;
set ppom;
yy=(y=3); logit=3;output;
yy=(y ge 2);logit=2; output;
yy=(y ge 1);logit=1;output;
run;

proc genmod desc;
class id logit;
model yy=x1 x2 logit logit*x1/link=logit dist=bin type3;
repeated subject=id/type=un;
run;

5 REPLIES 5
KKAY
Obsidian | Level 7

Is anyone could help me?

Ksharp
Super User

Maybe @Rick_SAS  or @StatDave  could give you a hand ?

KKAY
Obsidian | Level 7

Thank you for your reply! I will try! Thank you!

StatDave
SAS Super FREQ

That method is not necessary. It is now easy to fit a partial proportional odds model or a fully nonproportional odds model using the UNEQUALSLOPES and/or EQUALSLOPES options. The following fits the fully nonproportional odds model.

proc logistic data=ppom;
model y=x1 x2 / unequalslopes;
run;

See this note that provides much more detail and an example of fitting both the partial proportional odds model and fully nonproportional odds model.

KKAY
Obsidian | Level 7

Thank you very much! I will learn about what you suggest and try.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 5 replies
  • 642 views
  • 1 like
  • 3 in conversation