Programming the statistical procedures from SAS

proc LOGISTIC - detecting quasi-complete separation

Occasional Contributor TD
Occasional Contributor
Posts: 13

proc LOGISTIC - detecting quasi-complete separation

I have a macro which is used to do produce a number of Odds ratios for different datasets/subsets etc.. However, some comparisons produce warnings in the SAS log that I want to get rid of properly. The warning I refer is:

WARNING: There is possibly a quasi-complete separation of data points. The maximum likelihood estimate may not exist.

I can't change the model or anything proc logistic. The requirement is to not perform logistic analysis for such data. Is there a way in SAS I could reliably check data if proc logistic will through this warning or not (without producing errors or warnings in the log?). My theoretical solution is a little bit complicated (produce temp dataset to feed into proc logistic, run another SAS session (child process) with %sysexec that will only do proc logistic and check the log/lst/RC for abnormalities after child process finished running). So, I'd like to hear simpler/better approach to this problem.

p.s. NOWARN options is not a solution, because I need to see warnings for other cases and to skip data for logistic regression.

Thanks and happy around exp(7.6078780732785....) !

Kind regards,


Grand Advisor
Posts: 10,052

Re: proc LOGISTIC - detecting quasi-complete separation

Is it practical to use the Firth option with your data?

Respected Advisor
Posts: 2,655

Re: proc LOGISTIC - detecting quasi-complete separation

I like the Firth penalized ML method, but if that is not available due to prior decisions, I would try something like:

proc means data=yourdata nway noprint;

class iv1--iv<how many independent variables you have>

var dependent;

output out=datachek sum=sum;


I would then look at any situations where the sum was zero for one of the combinations of the independent variables.  By including appropriate ID variables, you could then exclude these cases from the dataset.  This assumes that the quasi-separability arises from categorical predictors which have only zeroes (or ones, but it is easier to find the zeroes) for some combination of the predictors.

Steve Denham

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation