3
$\begingroup$

I have a dataset where each record is a purchase, with user, datetime, low-cost/high-cost option chosen (y, boolean), quality, and opportunity price (the lowest priced option) as variables. The goal is to predict whether someone will purchase a low-cost option or a high cost option.

However, some users have multiple records because they have made multiple purchases at different times (I don't care about time in this case).

What is a good model / approach for this sort of data? I am assuming I cant just leave the records in their as is for a standard Logistic Regression because it would break the assumption of iid.

$\endgroup$
3
$\begingroup$

This is a typical application for mixed effects models - where you fit random effects, in particular, random intercepts, for user, and fixed effects for the other variables (hence "mixed" effects). Random intercepts takes into account non-independence, that choices by the same user will be more similar to each other than choices by other users. In this particular case, since it will be a logistic model it will be a generalised linear mixed model (GLMM). With this type of model you can make predictions for previous users or new users.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ curious, for hypothesis tests are there also frameworks to run 2-proportion z-tests and z-test for population means using mixed effects modeling? $\endgroup$ – J Doe Dec 13 '19 at 3:06
  • $\begingroup$ The question was about prediction. If you have questions about inference in mixed models, please ask a new question, but in general you can do the same or similar tests as models without random effects $\endgroup$ – Robert Long Dec 13 '19 at 8:12

Your Answer

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

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