I have a biased sample from a user activity dataset with known distributions of two variables, the amount of times a user logged in during last week (Poisson distribution) and user's weekly revenue (this one looks normally distributed). I need to create another biased sample from the same dataset and keep the same distributions for both of these variables. Here's my drawing of the situation:
So far I only managed to think of something like splitting all observations into bins, figuring out the number of observations I need in each bin in order for the distribution of the new sample to look like the distribution from the first one (for both variables) and then going through the dataset looking at each user like:
- this one is bin 3 for logins but bin 1 for revenue, check
- this one is bin 2 for logins and bin 1 for revenue, check
- this one is bin 4 for logins and bin 1 for revenue, but bin 1 for revenue is full so it goes nowhere... until all the bins are full.
But this seems tedious, naïve and possibly incorrect. What would be the correct way to do what I want?