tl;dr How to model the causal impact of X on binary Y when Y is very rare. Can I make groups and model count instead?

Background/What I tried

I want to know what the effect of the number of "likes" a profile gets (independent variable) in the first 30 days is on that person's eventual marriage (dependent variable, binary).

Out of my sample of 600k, only 10,000 get married within 5 years.

From buckets and a bar plot, it's clear that the more likes you get, the more likely you are to get married Plot 1

But because it's binary and because there are so few marriages, a scatterplot comes out without a clear trend (plot 2). So, when I tried to run a logistic regression my model just always predicted that the person wouldn't get married since it's so rare. That's fine, I'm not trying to predict, but I need to know the causal relationship. Plot 2

The Question

I think this is a "rare events" problem. It seems for prediction the standard approach is the oversample or weight the rare event so that you can build a logistic model that predicts better - but it seems that will mess with the accuracy of the causal conclusions as the marginal effect will then be skewed? Am I right to be concerned?

Another idea I had was since I have so many observations I could line up the dataset by size and make groups of 1000. Now the X variable is the mean # of likes in the group and the Y is the % (or could be count) of the group that got married. When I model that I get a much clearer trend, here's a plot that's zoomed in a bit. Plot 3

To me this seems like it works well but I'm worried because when I did a ton of googling I couldn't find this recommended as an ok approach for binary variables at all. Is it ok?

And if so, how do I then find the marginal impact for different sizes? It's clear to me the slope of the trendline changes at a few different points so I know the impact changes depending on size but I don't know how to get that.

THANK YOU! Any advice would be so appreciated as I've spend so much time trying to learn and don't have anyone IRL I can ask.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.