4
$\begingroup$

This question already has an answer here:

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?

$\endgroup$

marked as duplicate by kjetil b halvorsen, mdewey, Michael Chernick, Peter Flom Sep 22 '17 at 16:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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 Oct 3 '16 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 Oct 3 '16 at 15:48
2
$\begingroup$

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.

$\endgroup$
-1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Id like to see some justification for why the oversampling is neccesarry / what problem it solves. $\endgroup$ – Matthew Drury Feb 5 '17 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$ – Arpit Sisodia Feb 6 '17 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$ – Matthew Drury Feb 6 '17 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$ – Arpit Sisodia Feb 8 '17 at 9:31
  • $\begingroup$ when 1 ( positive class) are very less. This induced problem of class imbalance/ rare event scenario. one way to solve such scenario is to over sample the positive class or down sample the negative class(0). and then re-calibrate to actual probability. $\endgroup$ – Arpit Sisodia Feb 8 '17 at 9:34

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