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.
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.
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=...
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.
It seems that your data is unable to do a Poisson Model for SEX='XXX' , maybe it is small or sparse.
Anyway, calling @StatDave
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.