Contributor
Posts: 20

# Comparing two group small counts

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;

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;

Posts: 2,655

## Re: Comparing two group small counts

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

Contributor
Posts: 20