Fit and interpret logistic regression models for marketing data with a binary outcome and a mix of continuous and categorical predictors. Upload raw rows, pick your success outcome, and compare the marginal effects of each predictor on conversion probabilities with confidence intervals and diagnostics.
👨🏫 Professor Mode: Guided Learning Experience
New to logistic regression? Enable Professor Mode for step-by-step guidance through building and interpreting your first model!
QUICK START: Choose Your Path
TEST OVERVIEW & EQUATIONS
Logistic regression estimates how the probability of a binary outcome (such as convert vs. not convert) changes with several predictors \(X_1, X_2, \dots, X_p\). Each coefficient shows the unique association of a predictor with the log-odds of success, holding the others constant.
Here \(p_i = \Pr(Y_i=1 \mid X_{1i},\dots,X_{pi})\): the probability of the focal outcome for row \(i\). The score \(\eta_i\) combines that row's predictor values; the probability form converts it to a value between 0 and 1.
Each coefficient is tested against zero using the standard normal distribution.
What are we trying to beat? The null model
Without using any predictors, we could give everyone the same probability: the overall rate of the focal outcome in the rows used to fit the model. If 30% converted, everyone gets a 30% conversion probability. That is the null model (also called the intercept-only model).
The model test asks whether using customer characteristics improves fit over that starting point. For classification accuracy, we also compare against always choosing the most common outcome: with 30% conversions, always saying “did not convert” is 70% correct. These are related baselines for different questions.
Model comparison
\[\Delta D = D_{\text{null}} - D_{\text{model}}\]
A chi-square test asks whether the predictors, as a set, improve fit over an intercept-only model on the same rows.
Binary Outcome & Predictor Types
The outcome must be coded as a binary variable (for example, 0/1 or success/failure). Continuous predictors use their numeric scale. Categorical predictors are dummy-coded with a reference level, so each coefficient compares a category to its reference while holding other predictors constant.
DATA SOURCE
📚
Use a Case Study
Use presets to explore realistic use cases, such as ad spend vs. revenue or control vs. treatment on order value.
Each scenario can expose either a summary CSV of aggregated statistics or a raw data file that you can download, edit in Excel, and re-upload.
📚Use a Case Studyclick to switch
📂
Upload Your Data
Upload a CSV file with raw case-level data. Include one binary outcome column (0/1 or two categories) and multiple predictors (numeric or categorical). Headers are required.
Drag & Drop raw data file (.csv, .tsv, .txt, .xls, .xlsx)
Include headers; at least one binary outcome column and predictors (numeric or text for categorical).
No file uploaded.
📂Upload Your Dataclick to switch
INPUTS & SETTINGS
Assign Variables
Select your outcome (Y) and one or more predictors. Set predictor types and reference levels for categorical variables. Nothing is computed until you select Run analysis at the foot of this section.
Predictors
For categorical predictors, the Reference group is the baseline category all others are compared against. Choose the most common or control-condition level.
No data loaded.
Data Quality Summary
Confidence Level & Reporting
Set the significance level for hypothesis tests and confidence intervals.
Standardization affects model fitting and effect plots only. Summary statistics always report predictors on their original scale.
Before fitting: what can this data support?
Use two outcome categories and one independent case per row. Several records for the same customer are not independent cases. Repeated customers or time-ordered outcomes need a model and validation split that account for that structure.
Use information available before the outcome. To predict conversion, exclude purchase confirmation, final order value, or other columns only known after conversion. Those would reveal the answer rather than help predict it (data leakage).
Choose predictors for a reason. IDs and arbitrary numeric category codes are not meaningful continuous predictors. Missing rows, rare categories, and too many predictor terms can leave estimates unstable.
Associations are not intervention effects. An observed relationship can reflect omitted factors. Moving a simulator slider compares fitted profiles; it does not prove what changing that customer's behavior would cause.
Upload a CSV or load a scenario to begin.
VISUAL OUTPUT
Confusion Matrix
Advanced Options
(Pr ≥ threshold → predict 1)
Interpretation Aid
Reading the confusion matrix:
Rows = actual outcomes, columns = predicted outcomes
Diagonal cells (TN, TP) = correct predictions
Off-diagonal cells (FP, FN) = errors
Classification metrics:
Accuracy = overall % correct
Sensitivity = % of actual 1s correctly identified
Specificity = % of actual 0s correctly identified
Precision = % of predicted 1s that are actually 1
F1 Score = harmonic mean of precision and recall
Threshold adjustment:
Adjust the classification threshold to balance sensitivity vs. specificity based on your business priorities. A lower threshold catches more positives but increases false alarms.
Classification Performance (at threshold = 0.5)
Accuracy:–
Sensitivity (Recall):–
Specificity:–
Precision (PPV):–
F1 Score:–
Negative Predictive Value:–
ROC Curve: explore the catch-versus-false-alarm trade-offOptional · open to explore
ROC (Receiver Operating Characteristic) Curve
Imagine using this model to decide which customers to contact. A lenient cutoff catches more customers who will respond, but also contacts more who will not. A strict cutoff reduces false alarms, but misses more real responders. The curve lets you compare these choices.
Start with a score, then make a decision. A customer scored 0.60 is flagged when the cutoff is 0.50, but not when it is 0.70. Changing the cutoff changes who is flagged; it does not refit the model.
One cutoff gives one dot. Compare the flags with the outcomes you actually observed. Read across for false alarms among actual negatives; read up for catches among actual positives. These percentages use different groups as their denominators.
Sweep the cutoff to build the curve. Lowering it flags more rows: the dot moves toward the top-right, sometimes in steps or along one axis. Raising it moves toward the bottom-left. Flag nobody and you are at (0%, 0%); flag everybody and you are at (100%, 100%). The top-left would catch every actual positive without any false alarms.
A concrete example (illustrative): Suppose 100 customers really respond and another 100 do not. A dot at (20%, 80%) means you caught 80 of the 100 responders and flagged 20 of the 100 non-responders. You missed 20 responders. The horizontal 20% is not “20% of everyone contacted was wrong.”
Lenient: flag moreStrict: flag fewer
Move the slider and watch the highlighted dot. This also updates the confusion matrix above. The curve and AUC stay the same.
Run an analysis to try this with your own fitted data.
Horizontal axis: false alarms (FPR) Among rows that actually had the non-focal outcome, how many did we incorrectly flag? Prefer farther left.
Vertical axis: catches (TPR / sensitivity) Among rows that actually had the focal outcome, how many did we correctly flag? Prefer higher up.
Read the diagonal before judging the curve
The dashed diagonal is the no-ranking benchmark. Flagging 20% of each actual group lands at (20%, 20%). A point above it catches a larger share of the positives than of the negatives. Curves bowing toward the top-left offer better trade-offs. A curve below the diagonal suggests scores rank in the wrong direction; check the outcome coding and model.
AUC (Area Under the Curve):–
AUC summarizes ranking across cutoffs; run an analysis for a reading of this model.
AUC is not percent correct. An AUC of 0.80 means the model ranks an actual positive above an actual negative about 80% of the time across random pairs, counting a tied score as half a success. It does not mean 80% of customers were correctly classified at your chosen cutoff.
There is no automatically best cutoff. Choose based on the cost of a missed opportunity versus a wasted contact. AUC does not choose for you, does not check whether “70% likely” really happens 70% of the time, and can look reassuring when positives are rare. Check precision and held-out performance too. This curve uses the rows that fitted the model.
Predicted Probability Distribution
Interpretation Aid
These overlapping histograms show the distribution of predicted probabilities for cases where the outcome was actually 0 (blue) versus actually 1 (red). Good model discrimination means the distributions are well-separated—cases with outcome = 1 should cluster at higher predicted probabilities. Heavy overlap suggests the model has difficulty distinguishing the two groups. This complements the confusion matrix by showing the full probability spectrum before thresholding.
Predicted probabilities vs. focal predictor
Focal range (continuous):
Hold other predictors constant
Choose levels/values for the non-focal predictors used when plotting the focal curve.
Interpretation Aid
The line (or bars for categorical focals) shows the predicted probability that the focal outcome (coded as 1) occurs while holding other predictors constant at chosen values. Steeper slopes or larger gaps between bars imply stronger effects. Confidence bands/bars reflect the statistical uncertainty for those probabilities; wider bands mean less certainty. If bands for different settings overlap heavily, the model may not distinguish them well at those values.
Adjusted Odds Ratios
Independently scaled plots to avoid flattening continuous slopes
Continuous: per unit/SD • Zoomed scale
Categorical: level vs. reference • Relative contrast
Not statistically significant
Continuous PredictorsPer 1 unit / 1 SD
Categorical PredictorsContrasts vs. Baseline
Interpretation Aid
Reading odds ratios:
OR > 1 = increases odds of the outcome
OR < 1 = decreases odds of the outcome
OR = 1 (dashed line) = no effect
Example: OR = 2.0 means doubling the odds (100% increase)
Confidence intervals:
The horizontal bars show intervals at your selected confidence level. An interval including 1 is compatible with no association. Continuous and categorical terms are plotted on separate panels so small slopes (e.g. OR = 1.004) are not compressed by wide discrete contrasts.
SUMMARY STATISTICS
Summary Statistics
Outcome Variable
Variable
% Focal Outcome
Count Focal
Count Non-Focal
Total n
Provide data to see outcome summary.
Continuous Predictors
Variable
Mean
Median
Std. Dev.
Min
Max
Provide data to see summary statistics.
Categorical Predictors (% by level)
Predictor
Level
Percent
Provide data to see level percentages.
TEST RESULTS
⏳
Upload data to see your result
We'll compare fit with a null model, read association sizes, and check prediction separately
Model χ²
—
p-value
—
Pseudo R²
—
Accuracy on fitting rows
—
1. What baseline are we beating?
Run an analysis for your sample's baseline.
2. How large are the associations?
Read the adjusted odds ratios and their intervals, then compare two profiles in the simulator below. A small p-value does not tell you whether a difference matters for your decision.
3. Will predictions hold up?
Check Validation & scoring on rows the model did not fit. A significant fit test alone does not establish useful prediction.
Always choose the most common outcome (same fitting rows):—
Accuracy difference from that baseline:—
Regression Equation
Provide data to see the fitted regression equation.
The downloaded file includes your original raw data plus two columns: p_hat (the model’s
predicted probability of the focal outcome for each observation) and neg_loglik_contribution,
the individual contribution to the negative log-likelihood penalty used to fit the model.
⚠️ Separation Detected
Log-likelihood:–
Null deviance:–
Residual deviance:–
Model chi-square:–
Model p-value:–
Pseudo R-squared:–
Sample size (n):–
Alpha:–
⚠️ Sample Size Advisory:
Interpretation Aid
Model fit metrics:
Log-likelihood / Deviance: Lower deviance = better fit
Model χ² & p-value: Tests if predictors improve fit vs. intercept-only model. p < α = significant improvement
Pseudo R²: Improvement over the null model on the log-likelihood scale; not the percentage of variation explained
Important caveats:
Pseudo R² values are typically lower than linear R² — values of 0.2–0.4 often represent good fit
Very small n can produce unstable estimates or separation issues
p-values below α indicate evidence against the null; they do not establish practical importance
Managerial Interpretation
APA-Style Report
Coefficient Estimates (Log-odds and Odds Ratios)
Continuous slopes and categorical contrasts operate on different scales. They are organized into two dedicated tables below so you can appropriately read effect sizes.
Model InterceptRun analysis to see baseline model intercept.
Continuous PredictorsMarginal Effects per Unit / 1 SD
Multiplicative change in odds per 1-unit increase (holding other variables constant)
Predictor
Measurement Unit
Estimate (log-odds)
Standard Error
z
p-value
Odds Ratio (per unit)
OR CI (Lower)
OR CI (Upper)
Provide data to see continuous predictor estimates.
Categorical PredictorsContrasts vs. Reference Group
Multiplicative change in odds comparing each category level against its reference baseline
Predictor
Category Level
Reference Group
Estimate (log-odds)
Standard Error
z
p-value
Odds Ratio (vs. Ref)
OR CI (Lower)
OR CI (Upper)
Provide data to see categorical predictor estimates.
Show Combined Master Table (All Predictors in Model Order)
Predictor
Level / Term
Estimate (log-odds)
Standard Error
z
p-value
Odds Ratio
OR CI (Lower)
OR CI (Upper)
Provide data to see coefficient estimates.
The two right-hand bounds are on the odds-ratio scale: compare them with 1 (no association). The estimate and its standard error are on the log-odds scale, where no association is 0. Intervals describe uncertainty, not the range of individual customer outcomes.
Interpretation Aid
🎛️ What-If Probability Simulator
Build a hypothetical profile using the model you just fit. Move the sliders and toggles for each
predictor to see how the estimated probability of the outcome changes in real time, along with its
confidence interval. Use this to pressure-test decisions: "What is the predicted conversion
probability for this kind of customer?"
Predicted probability–
Run the model to simulate
Odds–
Log-odds (logit)–
Sample base rate–
Adjust the profile
Run a model to enable the simulator.
Compare two otherwise identical profiles
Choose one predictor to vary. Set a starting profile above and save it as A. Then adjust that predictor for B; the other inputs stay fixed at A.
Run a model to compare profiles.
The difference is in percentage points, not a relative percent change. It is a fitted association with the other predictors held constant, not proof of a causal effect. The individual probability ranges above do not give a confidence interval for the difference.
How to read this simulator
The gauge shows the model's estimated probability that the outcome equals the focal (success) category
for the profile you build. The shaded band on the gauge and the bracketed range in the readout are the
confidence interval for that predicted probability, at the confidence level you selected above.
Continuous predictors default to their sample mean and can be moved across their observed range.
Categorical predictors default to their most common level. All other predictors are held at whatever
you set them to, so each reading is a full hypothetical profile rather than a one-variable effect.
The interval reflects uncertainty in the estimated average probability for profiles like this
one; it is not a prediction interval for a single individual outcome.
Elasticities at the Means (Continuous Predictors Only)
What is this & how to read it
Elasticity formula:
For each continuous predictor \(X_j\), the elasticity of the predicted probability is:
where \(\hat{\beta}_j\) is the log-odds coefficient, \(\bar{p}\) is the predicted probability evaluated at the sample means of all predictors, and \(\bar{X}_j\) is the sample mean of predictor \(j\).
Interpretation:
An elasticity of 0.15 means: "a 1% increase in \(X_j\) is associated with approximately a 0.15 percentage-point increase in the predicted probability, evaluated at the means of all predictors." This captures the nonlinearity of logistic regression—the same coefficient has different probability impacts depending on where you are on the S-curve.
Important caveats:
Categorical predictors are excluded—there is no meaningful "1% increase" in a category. For categorical effects, use the odds ratios above.
"At the means" evaluates the probability at the arithmetic mean of each continuous predictor and, for each categorical predictor, its sample shares (each dummy column at its mean, the share of rows in that level) rather than a single level. This is a single representative point—elasticities vary across the probability curve.
Elasticities are local approximations. They are most accurate for small changes near the evaluation point. At extreme probabilities (near 0 or 1), the marginal effect of any predictor is compressed.
If the model uses standardized predictors, elasticities are computed on the standardized scale—a "1% increase" refers to the standardized value, not the original units.
Predictor
Mean (\(\bar{X}_j\))
Coefficient (\(\hat{\beta}_j\))
\(\bar{p}\) at means
Elasticity (\(\varepsilon_j\))
Interpretation
Run the model to see elasticities.
DIAGNOSTICS & ASSUMPTIONS
Diagnostics & Assumption Checks
Run the analysis to see checks on multicollinearity, outcome balance, rare categories, and probability calibration. Use these as prompts for plots and follow-up modeling, not as strict pass/fail gates.
Hosmer-Lemeshow Goodness-of-Fit Test
Run the analysis to see calibration test.
What does this test?
The Hosmer-Lemeshow test checks if predicted probabilities are well-calibrated—i.e., do cases with predicted probability ≈ 70% actually have the outcome 70% of the time? The test groups observations by predicted probability and compares observed vs. expected frequencies. A large p-value (> 0.05) means the test found no evidence of miscalibration. That is not proof of good calibration: the test has little power in small samples and can miss real problems. A small p-value (< 0.05) suggests the model's probability estimates may be systematically biased, even if classification accuracy is high.
Actual vs. Fitted
Interpretation Aid
Each point plots a fitted probability on the horizontal axis and the observed 0/1 outcome (with a small amount of vertical jitter for visibility) on the vertical axis. Points clustered near 0 or 1 on the x-axis indicate confident predictions; a mix of 0s and 1s at similar fitted probabilities indicates uncertainty. Strong patterns or obvious outliers can signal model misspecification or influential cases to review.
Residuals vs. Fitted
LEARNING RESOURCES
📚 When to use logistic regression
Use logistic regression when:
Your outcome is binary (e.g., converted/not, churned/retained, clicked/ignored)
You have one or more continuous or categorical predictors
You want to quantify how each predictor affects the probability of the outcome
Observations are independent of each other
You need interpretable odds ratios for business decisions
Yes/no outcome recorded period after period? (out of stock today, sold out on Saturday) Then the
rows are not independent: yesterday predicts today. Use
Dynamic Logistic Regression, which puts
last period's outcome in as a predictor and tests the forecast on periods it never saw.
Why logistic instead of linear regression?
Linear regression can predict values outside 0–1 for a binary outcome, which is nonsensical. Logistic regression constrains predictions to valid probabilities and uses maximum likelihood estimation. It also handles the inherent non-constant variance of binary data.
⚠️ Common mistakes to avoid
Ignoring class imbalance: If 95% of cases are "no," accuracy is misleading—check sensitivity, specificity, and AUC instead
Interpreting coefficients as probabilities: Log-odds coefficients are not percentage-point changes. Use the predicted probability chart to communicate effects
Too many predictors for your sample: A common rule of thumb is at least 10 events per predictor term (EPV ≥ 10). Fewer leads to unstable estimates
Perfect separation: If a predictor perfectly predicts the outcome, the model cannot converge. Watch for the separation warning
Multicollinearity: Highly correlated predictors inflate standard errors and make individual effects unreliable
Confusing odds ratios with risk ratios: OR ≈ RR only when the outcome is rare. For common outcomes, odds ratios exaggerate the effect on probability
Interpretation: A one-unit increase in \(X_j\) multiplies the odds of the outcome by \(e^{\beta_j}\). For categorical predictors, each dummy coefficient compares that level's odds to the reference level.