ARBIMETRA LAB
Logistic Regression
Models the probability of a binary outcome, with odds ratios, marginal effects and classification measures.
What it does
Models the probability of a binary outcome, with odds ratios, marginal effects and classification measures.
Use it for yes/no outcomes.
Data you need
- Binary dependent variable
- Independent variables
Optional: Classification threshold
Supported data: Numeric, Binary. Level: Intermediate.
Formula and method
log[p/(1−p)] = β₀ + β₁X₁ + … + βₖXₖ
The log-likelihood of a Bernoulli outcome with a logistic link is maximised by Newton's method. Standard errors come from the inverse information matrix, and average marginal effects are averaged across observations.
Assumptions
- Observations are independent
- Log-odds are linear in the variables
Input checks
- Exactly two outcome values
- Perfect separation is detected and rejected
How to read the result
An odds ratio above 1 means higher odds of the event for a one-unit increase.
Worked example
Illustrative run on Simulated study data (teaching data). These figures are the actual output of this model on that example, and they say nothing about your own data.
- LR chi-square = 40.2283, p = <0.0001, McFadden R² = 0.1211, in-sample AUC = 0.7321.
- The joint contribution of the variables is statistically significant at the 5% level.
Limitations
- In-sample classification is optimistic
Numerical validation
Validated 20 of 20 automated checks passed, including numerical results, invalid input, missing values, small samples, constant variables, charts and the interpretation text.
| Check | Reference | Result | Abs. error | Tolerance | Source |
|---|---|---|---|---|---|
| Logit by independent Newton | 1.2032926 | 1.2032926 | 2.2e-16 | 1e-7 | Independent NumPy calculation |
| Standard error from information | 0.13343176 | 0.13343176 | 0.0e+0 | 1e-6 | Independent NumPy calculation |
| Log-likelihood | -274.70492815 | -274.70492815 | 0.0e+0 | 1e-8 | Independent NumPy calculation |
| Odds ratio | 3.33106675 | 3.33106675 | 4.4e-16 | 1e-7 | Independent NumPy calculation |
| AUC by pair counting | 0.78536946 | 0.78536946 | 0.0e+0 | 1e-9 | Independent NumPy calculation |
Computed with python 3.13.2, numpy 2.2.5, scipy 1.14.1, pandas 2.3.3, statsmodels 0.14.4, scikit-learn 1.7.0, in your browser. A passing check confirms the listed comparison only. It does not make any result suitable for your data, and it is not a claim of equivalence with other statistical software.
Questions
Odds ratio or marginal effect?
An odds ratio is a multiplicative change in odds. An average marginal effect is the change in probability, which is often easier to explain.
ARBIMETRA LAB is an educational and research tool. Results should be checked by the researcher and are not professional advice.
