ARBIMETRA · Financial intelligence, made practical.

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.

CheckReferenceResultAbs. errorToleranceSource
Logit by independent Newton1.20329261.20329262.2e-161e-7Independent NumPy calculation
Standard error from information0.133431760.133431760.0e+01e-6Independent NumPy calculation
Log-likelihood-274.70492815-274.704928150.0e+01e-8Independent NumPy calculation
Odds ratio3.331066753.331066754.4e-161e-7Independent NumPy calculation
AUC by pair counting0.785369460.785369460.0e+01e-9Independent 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.