BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
niam
Quartz | Level 8

Hi I have a binary outcome variable and a binary predictor. Observations are grouped at DRIVERID level. 

When I run the model with using DIST=BIN and LINK=LOGIT, the model does not converge, however, if I just run the model without these two options, the model runs and gives me results. 

Can you please let me know why the model fails to converge when I specify that the DV is binary?

The following model runs:

proc gee data=ANALYSIS2 descend;
   class  DRIVERID ;
   model effct=TREATMENT ;
   repeated  subject=DRIVERID  / CORR=IND;
run;

This one does not run:

proc gee data=ANALYSIS2 descend;
   class  DRIVERID ;
   model effect=TREATMENT /dist=bin link=logit;
   repeated  subject=DRIVERID  / CORR=IND;
run;

Here is the error message I get:

The generalized Hessian matrix is not positive definite. Iteration will be terminated.

1 ACCEPTED SOLUTION

Accepted Solutions
niam
Quartz | Level 8

I found the answer myself. I explain it below and hope it can help someone else with the same problem:

In my case, the dependent variable is binary, so is the independent variable. However, the DV is equal to one only when the IV is one. In other words, I do not have any variation in my DV when the IV is equal to one. This will make it impossible to have a maximum likelihood estimator, and therefore the algorithm does not converge. The fix is to manually change the DV from 1 to 0 in just one observation in which the IV is 1.

View solution in original post

2 REPLIES 2
niam
Quartz | Level 8

I found the answer myself. I explain it below and hope it can help someone else with the same problem:

In my case, the dependent variable is binary, so is the independent variable. However, the DV is equal to one only when the IV is one. In other words, I do not have any variation in my DV when the IV is equal to one. This will make it impossible to have a maximum likelihood estimator, and therefore the algorithm does not converge. The fix is to manually change the DV from 1 to 0 in just one observation in which the IV is 1.

Tolawak
Calcite | Level 5

Dear Paige,

 

Thanks for your reply. Mine is a bit different as my independent variable (physical activity) has 3 categories (1=active, 2=moderate, 3=nactive).

Would please help me with this?

 

All the best,

Tola

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 2925 views
  • 0 likes
  • 2 in conversation