BookmarkSubscribeRSS Feed
Ashwini_uci
Obsidian | Level 7

Hi,

How  should I  deal with this warning which i got after running the proc logistic regression? is there any way to get rid of this? How do I know by how much to increase the MAXITER or what value to put for FCONVE GCONVE etc. I have never used these options before.

"Convergence was not attained in 25 iterations. You may want to increase the maximum number of iterations (MAXITER= option) or change the convergence criteria (ABSFCONV=, FCONV=, GCONV=, XCONV= options) in the MODEL statement." 

the code looks like...

proc logistic data =library.nismicathcabg4 descending ;

class  female  (ref= first) dm dmcx htn_c  aids alcohol ANEMDEF arth race1(ref=first)  ZIPINC_QRTL(ref=first) hosp_location h_contrl(ref=first) hosp_teach

bldloss chf chrnlung coag depress drug hypothy liver lymph lytes mets neuro obese para perivasc psych pulmcirc renlfail tumor

ulcer valve wghtloss cararrhythmia/param=ref;

model  died=  age female  dm dmcx htn_c  aids alcohol ANEMDEF arth race1 zipinc_qrtl hosp_location h_contrl hosp_teach  TOTAL_DISC prday1

bldloss chf chrnlung coag depress drug hypothy liver lymph lytes mets neuro obese para perivasc psych pulmcirc renlfail tumor

ulcer valve wghtloss cararrhythmia ;

where thrombolytic1=1 and stemi=0;

weight discwt;

title 'Logi Reg in-hosp mortality vs gender in POST-thrombolytic MI patients using "where" option with RACE +income  for nstemi ncluding PRDAY1';

run;

quit;

File is attached with the proc logistic outout with convergence warning

6 REPLIES 6
SteveDenham
Jade | Level 19

I would add /MAXITER=100 ITPRINT; to your model statement.  Examine the iteration history, and then you could address changing the convergence criteria depending on the behavior of the log likelihood.  However, just increasing the maximum number of iterations may solve your problems. It will not if the response surface is relatively flat and not well-characterized, i.e., you have 39 independent variables--the possibility of collinearity and lack of sufficient sample size to efficiently estimate all of these parameters can certainly lead to convergence problems.

Good luck.

Steve Denham

Reeza
Super User

How many observations do you have?

Ashwini_uci
Obsidian | Level 7

I have attached a file with proc logistic output with the convergence warning.. please have a look at it.

SteveDenham
Jade | Level 19

In the first model, nothing seems to be happening--I wonder about the response variable and quasi-complete separation.  I still think you should run with the ITPRINT option, to look at what the likelihood is doing at each iteration.

In the second model, the singularity problem rears its head.  Most likely, you have highly collinear variables in the model that convey almost exactly the same information.  What do crosstabs show?  I realize there are a lot of variables to check, but so long as the collinearity problem exists, the singularity problem is likely to arise.

Finally, addressing the question Reeza posed regarding number of observations, I think you are probably adequate in the second model, but near the edge for the first: 629 obs distributed over 47 indicator variables should be adequate, but only if the obs are evenly distributed.  If there are many combinations that are extremely sparse, convergence will be a problem.

To get to a workable situation, see if some of the variables can be eliminated.  Those that contain essentially identical information, based on crosstabs, can be combined.

Good luck.

Steve Denham

Doc_Duke
Rhodochrosite | Level 12

Only 8 subjects had the outcome (Died), so your model is hopelessly overspecified.  With that few outcomes, you can hardly fit one variable, let alone 47.

Doc Muhlbaier

Duke

Ashwini_uci
Obsidian | Level 7

Thanks Steve. that helps!

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!

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
  • 6 replies
  • 7801 views
  • 0 likes
  • 4 in conversation