Logistic Regression
A binary logistic fit by IRLS: coefficients, standard errors, z, p, odds ratios and the log-likelihood.
What this page computes
Put one observation per line as y, x1, x2 and so on, with y equal to 0 or 1. The page fits P(y = 1) = 1/(1 + e^(−Xβ)) by iteratively reweighted least squares, prints each coefficient with its standard error, z and two-tailed normal p, the odds ratio e^b for each predictor, and the maximised log-likelihood. Figures print to six significant figures.
The standard errors are the usual large-sample ones, and the p-values are normal approximations, not exact; the page says so on its last line. A y value other than 0 or 1 is refused by line, an outcome with no variation is refused, and a fit that has not converged in 50 iterations is refused rather than reported.
The fit runs in the browser and nothing is uploaded, so the same rows always give the same coefficients.
The page fits a logistic regression by iteratively reweighted least squares: the outcome must be 0 or 1 on every row, the predictors are the remaining columns, and the printed coefficients are on the log-odds scale with their standard errors, z statistics and two-tailed p-values. Ten rows with one predictor give an intercept of −1.13334 and a slope of 0.315131, with the odds ratio e^b = 1.37044 beside them. It takes at most four predictors, and an outcome with no variation at all is refused because there is nothing to model.
Fit a logistic regression from rows of a 0/1 outcome and up to four predictors, with odds ratios and normal-approximation p-values.
How to use it
Paste one row per line: the outcome first, then each predictor, comma-separated. The outcome must be exactly 0 or 1 on every line, and a value like 2 is refused by line number. The coefficient block labels the intercept and then b1, b2 and so on in column order, so it reads against your own file.
Log-odds, odds ratios and the approximation
The coefficients are log-odds, not probabilities: a slope of 0.315131 means the log-odds rise by that much per unit of the predictor, which is why the odds ratio is the exponentiated value and not the coefficient itself. The p-values come from a normal approximation to the z statistic, which is what IRLS gives cheaply and is close but not exact for small samples — the page says so rather than presenting it as an exact test. No model is selected for you and no interaction terms are added.
What to Expect
Best for
- A first logistic fit on a small table of rows
What this tool keeps
- Nothing leaves this tab: the arithmetic runs in the page you are reading, and a reload discards both the input and the result.
Sample input
0, 1 1, 2 0, 2 1, 3 0, 3 1, 4 0, 4 1, 5 0, 6 1, 6
Sample output
log-likelihood = -6.62252, n = 10 rows, 1 predictor(s) coefficients (estimate, SE, z, two-tailed p): intercept = -1.13334, SE 1.61919, z -0.69994, p 0.483965 b1 = 0.315131, SE 0.412874, z 0.763262, p 0.445307 odds ratios: 1.37044 (one per predictor, e^b) fitted by IRLS; the p-values are normal-approximation, not exact
Frequently asked questions
How are the rows laid out?
One row per line: the 0/1 outcome first, then each predictor, comma-separated. A line whose first value is not 0 or 1 is refused by line number.
Are the p-values exact?
No. They come from a normal approximation to the z statistic produced by IRLS, which the page states. They are close for moderate samples and should not be read as exact for a handful of rows.
Is my table uploaded?
No. The fit runs in this page on the pasted rows, so nothing is posted to a server and a reload discards both the table and the coefficients.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.