I will be doing a logistic regression to determine if a number of variables influence whether or not a patient received a certain health care service. I will likely have approximately 500 or so observations, and there will likely be far more zeros (patient did not receive service) than ones (patient did receive service).

In the event that I have a very small amount of ones (I am guessing I will have maybe 20-30), what would be the best method to account for this?

  • 1
    $\begingroup$ It might come down to what you mean by "a number of variables." Rules of thumb suggest your data cannot help you estimate the coefficient of more than one variable for every 15 observations in the smaller of the two classes (zeros and ones). That would limit you to two variables you can study (unless there are exceptionally strong, consistent relationships between the response and some of the variables.) $\endgroup$
    – whuber
    Commented Oct 3, 2016 at 15:44
  • 2
    $\begingroup$ Another thing to look out for is separation when one of your predictors perfectly predicts one or zero. See this post. This can be a problem with any size of study but is more likely in the circumstances you outline. $\endgroup$
    – mdewey
    Commented Oct 3, 2016 at 15:48

2 Answers 2


Logistic regression does not care about the degree of skew that you have (more events than non-events, or vice versa); the math will work out fine in that sense. Since you mention that you wish to adjust for multiple variables, you will be very limited here. There are various "rules of thumb" concerning how many events per variable should be used. 10 or 15 EPV are quite common, though one may need at lest 50 in some cases to avoid excessive bias in parameter estimation. The best thing to do is almost always collect more data, but assuming this is not possible, you will have to select the most interesting one or two variables.


This is exactly what I had faced in using logistic model in ad-click prediction.Your data suffers from rare event scenario. The best way is to -

1) over sample the positive class.(Calibrate the probabilities) At least 10 % positive class.

2) Run logit model.

3) re-calibrate the inflated probabilities.As by over sampling you will get inflated probabilities.

One thing also, which might be helpful for you is to use L-1 regularisation because many 0s will make your data sparce.

hope this will certainly help.

  • 1
    $\begingroup$ Id like to see some justification for why the oversampling is neccesarry / what problem it solves. $\endgroup$ Commented Feb 5, 2017 at 21:13
  • $\begingroup$ I came to know about it by reading many research papers on Ad-Click prediction. eecs.tufts.edu/~dsculley/papers/ad-click-prediction.pdf . go to 6.2 and 6.3 in pdfs.semanticscholar.org/daf9/… . $\endgroup$ Commented Feb 6, 2017 at 7:37
  • $\begingroup$ That paper clearly says that the only reason they subsample is to reduce the time to train the model. Is this really relevant when the poster has only 500 data points? $\endgroup$ Commented Feb 6, 2017 at 13:53
  • $\begingroup$ not just for reduce time . This is the way to solve for "Class Imbalance Problem". Exactly the same scenario mentioned in Kalra. $\endgroup$ Commented Feb 8, 2017 at 9:31
  • 1
    $\begingroup$ The class imbalance problem does not affect probabilistic models. Balancing procedures were invented to solve issues with non-probabilistic models like support vector machines, which make it difficult to assign classes in multi (> 2) class problems. Since logistic regression is a probabilistic model that assigns well calibrated probabilities, one should not balance their data idly. $\endgroup$ Commented Feb 8, 2017 at 16:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.