BookmarkSubscribeRSS Feed
twotwotwo
Calcite | Level 5

Hi,

I have a question about a comparison of two groups of data, which are small count.  The following are the code.  However, when I fit the model, the "contrast" p-value cannot be calculated.  And SAS always give me the warning:

WARNING: The negative of the Hessian is not positive definite. The convergence is questionable.

WARNING: The procedure is continuing but the validity of the model fit is questionable.

WARNING: The specified model did not converge.

WARNING: Negative of Hessian not positive definite.

Is there any problem with my code?  The following is the data and the code:

data test;

input diet total;

cards;

1 1

1 0

1 1

1 1

1 2

1 0

1 0

1 4

1 1

1 1

1 1

1 3

1 1

1 3

1 0

1 3

1 1

1 3

1 1

2 3

2 2

2 2

2 2

2 4

2 1

2 3

2 4

2 1

2 3

2 0

2 5

2 2

2 6

2 2

2 1

2 2

2 2

2 2

2 0

3 0

3 0

3 0

3 0

3 0

3 0

3 0

3 0

3 0

3 0

3 0

3 0

3 0

3 0

3 0

3 0

4 4

4 5

4 4

4 3

4 4

4 7

4 4

4 3

4 2

4 4

4 1

4 2

4 2

4 3

4 4

4 0

4 2

4 5

;

proc genmod data=test;

class diet;

model total=diet / dist=poisson link=log;

contrast 'group, 1 vs. 2' diet 1 -1 0 0;

contrast 'group, 1 vs. 3' diet 1 0 -1 0;

contrast 'group, 1 vs. 4' diet 1 0 0 -1;

run;

2 REPLIES 2
SteveDenham
Jade | Level 19

I think you have a problem with nearly complete quasi-separation.  For diet=3, all observations are zeroes, so the optimization fails.  PROC GLIMMIX is a little more robust, so you could try:

proc glimmix data=test;

class diet;

model total=diet / dist=poisson link=log solution;

contrast 'group, 1 vs. 2' diet 1 -1 0 0;

contrast 'group, 1 vs. 3' diet 1 0 -1 0;

contrast 'group, 1 vs. 4' diet 1 0 0 -1;

run;

Hope this helps.

Steve Denham

twotwotwo
Calcite | Level 5


Thanks Steve!  It works.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 4982 views
  • 1 like
  • 2 in conversation