# explaining an extremely large coefficient in a rare events logistic regression

I am running a rare events logistic regression on a binary dependent variable. I have 538 observations and only 10 events (so 528 values of 0 and 10 of 1), which is why I chose to use a rare events logistic regression.

When I run the regression, one of the independent variables in the model has a huge coefficient (around 25,000,000) and is found to be significant. The range on the independent variable is 0 to 1. Is this a problem? Could anyone explain why this is happening?

When I run the same model with just a logistic regression this variable is insignificant.

I'm not sure what is happening. Any advice would be appreciated.

• Did you ever find an answer to that question? I am asking because I seem to experience the same problem. – user91294 Oct 5 '15 at 20:21

In all likelihood, you have a poorly diagnosed complete separation / perfect prediction in your model: a combination of the explanatory variables (if you used interactions), or more likely a single explanatory variable, uniquely identifies one of the rare events. Let's say that if x > 10, then the outcome is always a one, while for x < 10, there can be a mix of zeroes and ones. What happens then is that the greater the coefficient for x, the closer you can get the predicted probability to 1 for the cases with x > 10. Since their contribution to the likelihod is $\ln \hat p_i$, maximum likelihood keeps pushing that number up to the extent possible (while maintaining the other coefficients in bay so that the probabilities for x<10 are OK), and sky is the limit... except that the finite precision of computer arithmetic prevents that from technically happening, so you will stop somewhere around $\hat p_i = 1-10^{-8}$ or so. This is a known problem for glm in R; Stata diagnoses this and drops the perfectly predicted observations.

You need to identify which of your explanatory variables perfectly predicts the outcome, and do something about it -- exclude it from regression, find another measure of the underlying concept, etc. Another solution is to use Firth logistic regression, which is a frequentist version of Bayesian regression with Jeffrey's prior, or, in a distant way, a version of ridge regression for binary outcome.

• (+1) Though I wouldn't call it a problem (& R does warn you you've predicted probabilities of nought or one - IMO it's better behaviour on the part of a computer to do what you tell it to rather than try to be clever), or say you need to fix anything more than the invalid Wald confidence intervals. (I'd guess those are why the predictor's insignificant" when the OP runs "just a logistic regression", scil. logistic regression fit by maximum-likelihood.) – Scortchi Oct 5 '15 at 21:39
• If you can't explain what the computer has done, then it is probably better for the computer to be at least marginally smart. – StasK Oct 8 '15 at 3:12

On this information, my best guess is outlier(s).

The range of a variable being 0 to 1 does not stop there being outliers in the data: in a strong sense, rare events logistic is precisely that, an exercise in handling data sets with marked outliers on a response with scale 0 to 1.

Much also depends on your predictor set, on which zero information here.

But whether the predictor concerned is binary or continuous, outliers are still possible. What you are seeing may also be a direct or indirect side-effect of the model being too complicated.

Plotting the data seems the next obvious step.

However, showing us some output should allow better guesses.