4
$\begingroup$

Want to understand if I'm using the binary logit regression correctly and that my data does not violate any assumptions.

An example of my data is below. I'm attempting to determine if a customer will reorder a pizza based on their past order history. The column "survived" indicates whether or not the customer survived to order again.

I'm assuming that as orders grow, customers will be less likely to reorder the same pizza (maybe they get tired of the same old pizza?).

My goal is to be able to determine, given my customer base, and how many orders they've placed to this date, what the probability of a re-order is.

My concern is that the yes/no survived in period X is dependent on the survival of the customer in period X-1.

Thank you for the help/tips.

[
 {
   "Customer": 1,
   "OrderNum": 1,
   "PizzaType": 1,
   "Survived": 1
 },
 {
   "Customer": 1,
   "OrderNum": 2,
   "PizzaType": 1,
   "Survived": 1
 },
 {
   "Customer": 1,
   "OrderNum": 3,
   "PizzaType": 1,
   "Survived": 0
 },
 {
   "Customer": 2,
   "OrderNum": 1,
   "PizzaType": 1,
   "Survived": 0
 },
 {
   "Customer": 3,
   "OrderNum": 1,
   "PizzaType": 2,
   "Survived": 1
 },
 {
   "Customer": 3,
   "OrderNum": 2,
   "PizzaType": 2,
   "Survived": 0
 }
]
$\endgroup$

1 Answer 1

4
$\begingroup$

So, instead of trying to explain every detail about the correct use of logistic regression, I'll provide some references that do a good job at explaining assumptions.

  1. Assumptions -- In order to build a good statistical model, you'll have to understand the underlying model assumptions, and ensure your data is appropriate. Given that your outcome variable is binary (survived: 0/1), logistic regression is appropriate. However, it seems you have repeated measures per customer, so each observation is not $i.i.d.$ (independent and identically distributed); this is assumption #3. You're probably fine if you address the potential assumption violation in a report. Otherwise, you'd have to use a different model or perform additional testing. See the following for details on assumptions: https://statistics.laerd.com/spss-tutorials/binomial-logistic-regression-using-spss-statistics.php

  2. Interpretation:

When you see your logistic regression output, your coefficients will be reported in the form of

$\log \frac{p(y = 1 | x)}{1-p(y = 1 | x)} = \beta_0 + ... + \beta_p$ for the $p$ covariates you include in your model. If you are specifically interested in probably of outcome given your data, and do not want to deal with log-odds ratios or odds ratios, you'll have to do some transformation of coefficients.

$p(y = 1 | x) = \frac{1}{1 - e^{-(\beta_0 + ... + \beta_p)}}$

Please see the following for further details: http://www.stat.cmu.edu/~cshalizi/uADA/12/lectures/ch12.pdf

Finally, here is a worked out example in R: http://www.ats.ucla.edu/stat/r/dae/logit.htm Other examples are available in other software if you do not use R.

  1. Autocorrelation

    My concern is that the yes/no survived in period X is dependent on the survival of the customer in period X-1.

With that said, you want a logistic regression model with AR-1 covariance residual structure. If you are simply interested in population average effects (i.e. fixed effects), I would perform a Generalized Estimating Equation; these models are relatively straightforward and not too computationally intensive. Otherwise, if you're concerned with individual effects (i.e. random effects) you'll need to use a Logistic Mixed-Effects Model. These models carry more assumptions and computational convergence issues. Please see the next reference: http://www.ats.ucla.edu/stat/mult_pkg/glmm.htm

Here is a worked out example with logistic linear mixed-effects: http://www.ats.ucla.edu/stat/r/dae/melogit.htm

Hope this helps.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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