BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
zihdonv19
Obsidian | Level 7

I'm trying to do a stratified analysis (by sex) using proc genmod. But it always gives error message, no matter I used "by" or make male/female in separate datasets:

WARNING: The generalized Hessian matrix is not positive definite. Iteration will be terminated.
ERROR: Error in parameter estimate covariance computation.
ERROR: Error in estimation routine.
WARNING: Output 'Estimates' was not created.  Make sure that the output object name, label, or path is
         spelled correctly.  Also, verify that the appropriate procedure options are used to produce the
         requested output object.  For example, verify that the NOPRINT option is not used.

The code I use:

proc genmod data=temp  descending;
by sex; class id; model qtsmo=agecat byear medication/ dist=poisson link=log; repeated subject=id/type=ind; estimate 'RR medication vs. non-medication' medication 1 /exp; ods output Estimates=outtab; run;

Is it possible to do stratified analysis using proc genmod? What might be potential solution in my case? Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

Questions about statistical procedures will get more attention from statisticians if you post them in the Statistical Procedures community under Analytics.

This could be the same problem, similar to sparseness in logistic models, as described for Poisson models in this note

If you are trying to estimate relative risks, your GENMOD approach is described in this note but other methods are also shown. If the problem is not related to the problem in the previously mentioned note, then perhaps one of those other methods will work.

View solution in original post

3 REPLIES 3
zihdonv19
Obsidian | Level 7

What I want to estimate is:

When sex=male, medication group vs. non-medication group, RR=...

When sex=female, medication group vs. non-mediaction group, RR=...

StatDave
SAS Super FREQ

Questions about statistical procedures will get more attention from statisticians if you post them in the Statistical Procedures community under Analytics.

This could be the same problem, similar to sparseness in logistic models, as described for Poisson models in this note

If you are trying to estimate relative risks, your GENMOD approach is described in this note but other methods are also shown. If the problem is not related to the problem in the previously mentioned note, then perhaps one of those other methods will work.

Ksharp
Super User

It seems that your data is unable to do a Poisson Model for SEX='XXX' , maybe it is small or sparse.

Anyway, calling @StatDave 

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 346 views
  • 0 likes
  • 3 in conversation