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;
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.
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:
Koen
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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.