Regression (Attributive)

Binary logistic, Poisson, and negative binomial regression for attributive/count data

Overview

Regression for attributive data extends classical (OLS) regression with methods for discrete, categorical, and count data. When the response is not continuous and normally distributed — e.g. "pass/fail", "defect count", or "complaints per batch" — Generalized Linear Models (GLM) provide more reliable estimates than OLS.

Binary logistic regression: For a binary response (0/1, OK/NOK). Models the probability P(Y=1|X) via the logit link: logit(p) = β₀ + β₁X₁ + … Coefficients are interpreted as odds ratios.

Poisson regression: For count data (0, 1, 2, 3, …). Models the expected value E(Y|X) = exp(β₀ + β₁X₁ + …). Coefficients are interpreted as rate ratios. Assumption: variancemean.

Negative binomial regression: Like Poisson, but for count data with overdispersion (variance > mean). An additional dispersion parameter θ captures the extra variability.

IRLS: Iteratively Reweighted Least Squares — the universal algorithm behind all GLMs. It reduces the problem to weighted OLS at each step until the coefficients converge.

Practical example

Scenario: A soldering process produces PCBs classified as OK or NOK (binary response). The predictors are solder temperature (continuous, 220–255 °C) and pressure (continuous, 2.0–3.5 bar).

  • Y = Defect (0 = OK, 1 = NOK)
  • X₁ = Temperature, X₂ = Pressure
  • Method: Binary logistic regression
  • Model: logit(P(Defect)) = β₀ + β₁·Temperature + β₂·Pressure
  • Result e.g.: OR(Temperature) = 1.08 → each °C increase raises defect odds by 8%

In the "Example data" tab you will find "Solder Inspection (logistic GLM)" — a ready-to-load dataset for trying this example directly.

Interpreting results

Key metrics at a glance:

Odds Ratio (OR): Logistic regression: OR > 1 means a unit increase in X raises the odds of Y=1. OR = 2.5 means odds increase by a factor of 2.5. OR < 1 = decreasing odds. The confidence interval must not contain 1 for the effect to be significant.

Rate Ratio (RR): Poisson/NegBin: RR > 1 means a unit increase in X raises the expected count. RR = 1.3 means 30% more expected events. Interpretation analogous to OR.

Pseudo-R²: GLMs have no true R². Instead, pseudo-R² measures (McFadden, Cox-Snell, Nagelkerke) quantify model improvement over the null model. Values > 0.2 (McFadden) are already considered a good fit.

AUC / ROC: For logistic regression: the area under the ROC curve (AUC) measures the model's discriminatory power. AUC = 0.5 = random, AUC > 0.8 = good, AUC > 0.9 = excellent.

Overdispersion: For Poisson data: if Pearson χ²/df is clearly above 1 (> 1.5), overdispersion is present. Solution: use negative binomial regression instead of Poisson.

Advanced options

The module supports several specialized cases beyond the standard workflow.

Trials column (grouped binomial regression): When data come as success proportions per group (e.g. 12 of 50 solder joints defective = 0.24 with 50 trials), select Y = proportion and fill the "Trials" column. The module reads Y as proportion and weights the likelihood by trial counts. Without a trials column, Y must be binary 0/1.

Swap success class: For two observed Y levels (e.g. "Pass"/"Fail") the module defaults to coding the higher level as "success = 1". The result header shows the current success class with a swap button — one click flips the coding and refits. Useful when odds ratios should be read in the other direction.

Categorical predictors: "Text"-typed columns are automatically treated as categorical predictors. The alphabetically first level becomes the reference; each additional level gets a dummy variable with its own coefficient. Example: Shift ∈ {A, B, C} → terms "Intercept", "Shift[B]", "Shift[C]"; A is the reference.

Quasi-Poisson (automatic): When the Poisson model is overdispersed (χ²/df > 1.5), the module automatically activates quasi-likelihood scaling: standard errors and confidence intervals widen by √φ̂. A "Quasi-Poisson active (φ = …)" warning appears in the result. Point estimates of the coefficients are unchanged.

θ convergence for negative binomial: For near-Poisson data, θ → ∞ and the θ estimation is unstable. The module detects this via a sign check on the score equation and emits the warning "θ estimate did not converge". Recommendation: switch to Poisson, or fix θ manually.

Separation detection: Strong separation (a predictor almost perfectly splits the classes) is flagged via combined criteria: |η| pegs at the clip, IRLS weights span > 8 orders of magnitude. The "Complete or quasi-complete separation" warning recommends dropping the separating predictor or merging classes.

Common pitfalls

  • Applying OLS to binary data: yields probabilities outside [0, 1] and invalid p-values. Always use logistic regression.
  • Ignoring separation: if a predictor perfectly separates Y, coefficients become infinite. Pay attention to the module warning.
  • Overlooking overdispersion in Poisson: if χ²/df > 1.5, standard errors are too small and p-values too optimistic. Use negative binomial instead.
  • Interpreting pseudo-R² like R²: a McFadden R² of 0.3 is already a good model. Values near 1 are rare with attributive data.
  • Reading odds ratios as risk ratios: OR ≠ RR. For rare events (< 10%), they are similar; otherwise, they are not.

Examples

This module ships with the following example datasets — load any of them in the app with a single click.

Available in the following cycles

  • DMAIC: Improve
  • DMADV: Design
  • 8D: D5 — Corrective Actions