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

I'm running two very similar models with proc GEE. They have binary outcomes and are accounting for correlated observations, because some patients were resampled.  Almost everything is the same, including the cohort, predictors, and outcome variable (a categorical variable with 4 levels - A, B, C, and D). The only difference between the models is the way I've coded the outcome: the outcome in the first model is "B" vs "not B" (A, C, and D) whereas the outcome in the second model is "D" vs "not D" (A, B, and C). The first model is running fine, but the second model produces the error: "WARNING: The generalized Hessian matrix is not positive definite. Iteration will be terminated."  

 

proc GEE data = all;
	Format  Sample GEE_Sample. binary_MA_TM $GEE_binary. sex_new $GEE_Sex_new. anydual_cat $GEE_anydual_cat.
			agecat_new_cat $GEE_agecat_new_cat.	year_new_cat $GEE_year_new_cat. state_q $GEE_Quartile. 
			zpmed_cat $GEE_Quartile. zpcol_cat $GEE_Quartile.;
	class patient_id binary_MA_TM sample sex_new anydual_cat race_new_cat 
		  agecat_new_cat year_new_cat zpmed_cat zpcol_cat RUC state_q;
	model binary_MA_TM = sample sex_new anydual_cat race_new_cat agecat_new_cat 
		  year_new_cat zpmed_cat zpcol_cat RUC state_q /link=logit dist=bin;
	repeated subject = patient_id / within = year_new_cat;
	lsmeans sample sex_new anydual_cat race_new_cat agecat_new_cat year_new_cat
			zpmed_cat zpcol_cat RUC state_q / diff oddsratio cl nomeans plots=none;
run;

proc GEE data = all;
	Format  Sample GEE_Sample. binary_TM_MA $GEE_binary. sex_new $GEE_Sex_new. anydual_cat $GEE_anydual_cat.
			agecat_new_cat $GEE_agecat_new_cat. year_new_cat $GEE_year_new_cat. state_q $GEE_Quartile.
			zpmed_cat $GEE_Quartile. zpcol_cat $GEE_Quartile.;
	class  patient_id binary_TM_MA sample sex_new anydual_cat race_new_cat 
		   agecat_new_cat year_new_cat zpmed_cat zpcol_cat RUC state_q;
	model binary_TM_MA = sample sex_new anydual_cat race_new_cat agecat_new_cat
		  year_new_cat zpmed_cat zpcol_cat RUC state_q /link=logit dist=bin;
	repeated subject = patient_id / within = year_new_cat;
	lsmeans sample sex_new anydual_cat race_new_cat agecat_new_cat year_new_cat
			zpmed_cat zpcol_cat RUC state_q / diff oddsratio cl nomeans plots=none;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

As I wrote in one of the posts on this issue that Koen's link refers to: 

Unfortunately, convergence can never be guaranteed for any iterative estimation algorithm such as maximum likelihood or Generalized Estimating Equations. Nonconvergence can happen for many reasons, but just as with ordinary logistic models, sparseness is very often the cause of such problems since it can result in some model parameters actually being infinite. Generally, as model complexity increases and sample size decreases, the problem becomes more sparse and more likely to result in convergence problems. Starting with a simple model (that is, one with fewer parameters to estimate) and only adding variables as they can be supported is often a good strategy.

View solution in original post

2 REPLIES 2
sbxkoenk
SAS Super FREQ

Go to https://www.google.com/

... then enter in Search field :

"generalized Hessian matrix is not positive definite" site:communities.sas.com

 

Or click this link for the same:

https://www.google.com/search?q=%22generalized+Hessian+matrix+is+not+positive+definite%22+site%3Acom...

 

Koen

StatDave
SAS Super FREQ

As I wrote in one of the posts on this issue that Koen's link refers to: 

Unfortunately, convergence can never be guaranteed for any iterative estimation algorithm such as maximum likelihood or Generalized Estimating Equations. Nonconvergence can happen for many reasons, but just as with ordinary logistic models, sparseness is very often the cause of such problems since it can result in some model parameters actually being infinite. Generally, as model complexity increases and sample size decreases, the problem becomes more sparse and more likely to result in convergence problems. Starting with a simple model (that is, one with fewer parameters to estimate) and only adding variables as they can be supported is often a good strategy.

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