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
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
How many observations do you have?
I have attached a file with proc logistic output with the convergence warning.. please have a look at it.
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
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
Thanks Steve. that helps!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.