29
$\begingroup$

What is the difference between logistic and logit regression? I understand that they are similar (or even the same thing) but could someone explain the difference(s) between these two? Is one about odds?

$\endgroup$
3
  • 1
    $\begingroup$ Same thing. In Stata, one gives you the odds ratios, the other gives you the log of the odds ratios. $\endgroup$ Oct 16, 2014 at 17:12
  • 2
    $\begingroup$ See Stas K's answer in stats.stackexchange.com/questions/27662/… A short answer is: same thing with different emphases in reporting. $\endgroup$
    – Nick Cox
    Oct 16, 2014 at 17:45
  • 4
    $\begingroup$ As with so many things, it depends on who is doing the speaking. Different people use terms in different ways, unfortunately. For example, some people would say they're the same, but other people would use "logistic function" (and hence sometimes even 'a logistic regression') to refer to a nonlinear regression function that's a multiple of the logistic cdf, and which would be a different thing to looking at what's called a logit-link in a GLM. $\endgroup$
    – Glen_b
    Oct 17, 2014 at 0:29

2 Answers 2

40
$\begingroup$

The logit is a link function / a transformation of a parameter. It is the logarithm of the odds. If we call the parameter $\pi$, it is defined as follows:
$$ {\rm logit}(\pi) = \log\bigg(\frac{\pi}{1-\pi}\bigg) $$ The logistic function is the inverse of the logit. If we have a value, $x$, the logistic is:
$$ {\rm logistic}(x) = \frac{e^x}{1+e^x} $$ Thus (using matrix notation where $\boldsymbol X$ is an $N\times p$ matrix and $\boldsymbol\beta$ is a $p\times 1$ vector), logit regression is:
$$ \log\bigg(\frac{\pi}{1-\pi}\bigg) = \boldsymbol{X\beta} $$ and logistic regression is:
$$ \pi = \frac{e^\boldsymbol{X\beta}}{1+e^\boldsymbol{X\beta}} $$ For more information about these topics, it may help you to read my answer here: Difference between logit and probit models.


The odds of an event is the probability of the event divided by the probability of the event not occurring. Exponentiating the logit will give the odds. Likewise, you can get the odds by taking the output of the logistic and dividing it by 1 minus the logistic. That is:
$$ {\rm odds} = \exp({\rm logit}(\pi)) = \frac{{\rm logistic}(x)}{1-{\rm logistic}(x)} $$ For more on probabilities and odds, and how logistic regression is related to them, it may help you to read my answer here: Interpretation of simple predictions to odds ratios in logistic regression.

$\endgroup$
0
0
$\begingroup$

This answer applies for scikit-learn in python.

Both logit from statsmodels and LogisticRegression from scikit-learn can be used to fit logistic regression models. However, there are some differences between the two methods.

Logit from statsmodels provides more detailed statistical output, including p-values, confidence intervals, and goodness-of-fit measures such as the deviance and the likelihood ratio test. It also allows for more advanced modeling options, such as specifying offset terms, incorporating robust standard errors, and modeling hierarchical data structures.

LogisticRegression from scikit-learn, on the other hand, provides a more user-friendly interface and is better suited for large-scale machine learning applications. It allows for easy cross-validation, regularization, and feature selection, and is generally faster and more scalable than logit from statsmodels.

In this case, either logit or LogisticRegression could be used to fit the logistic regression model with the two indicator variables. The choice between the two methods may depend on the specific needs of the analysis, such as the desired level of statistical inference or the computational resources available.

$\endgroup$
1
  • $\begingroup$ Yes, the distinction lies only in the implementation of keywords "logit" / "logistic" inside various statistical software packages. Python is not even the best shell for running logistic regression. I would name R or SPSS. Maybe SAS (but less user-friendly). $\endgroup$
    – stans
    Nov 19 at 12:26

Your Answer

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

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