← All Posts
Machine Learning · Regression· Assumptions

Assumptions of Linear and Logistic Regression

An assumption is a condition needed for a particular claim. Some assumptions affect the coefficient itself. Others affect only standard errors, confidence intervals, or probability calibration. A violation does not always make the entire model useless; it changes which conclusions remain valid.

Assumptions Shared by Both Models

AssumptionPlain meaningCommon failure
Representative dataTraining rows resemble the population where the model will be used.Selection bias or deployment drift.
No leakageEvery feature is available at prediction time.Future values or post-outcome fields enter training.
Correct feature shapeThe chosen columns can represent the important relationship.Missing curvature, interaction, or subgroup effect.
Independent information in columnsNo predictor is an exact copy or combination of others.Duplicate columns or the dummy-variable trap.
Appropriate row dependenceRows treated as independent are genuinely independent, or dependence is modeled.Repeated patients, users, locations, or time points.
Stable preprocessingTraining and serving use the same units, categories, scaling, and missing-value rules.Train-serve skew.

Linear Regression Assumptions

The population model is

$$Y=X\beta+\varepsilon.$$
AssumptionWhy it mattersIf it fails
Linear conditional mean in the chosen features$X\beta$ correctly describes $E[Y\mid X]$.Residual curvature calls for justified transformations or another model.
$E[\varepsilon\mid X]=0$Included predictors have no remaining average error pattern.Coefficients may be biased because of omitted variables, reverse causation, or selection.
Full column rankCoefficients are unique.Redundancy must be removed or resolved with a constraint or pseudoinverse.
Constant error varianceNeeded for the textbook OLS standard-error formula and BLUE claim.Coefficients may remain unbiased, but robust or variance-aware uncertainty is needed.
Uncorrelated errorsNeeded for ordinary standard errors.Cluster, time-series, or another dependence-aware covariance is needed.
Normal errorsNeeded for exact small-sample $t$ and $F$ inference.Large-sample inference may still work; tail behavior determines a suitable alternative.
Key distinction. Heteroscedasticity does not automatically bias OLS coefficients. It mainly breaks the usual variance formula. By contrast, $E[\varepsilon\mid X]\ne0$ can bias the coefficients themselves.

Logistic Regression Assumptions

Logistic regression models

$$\operatorname{logit}\big(P(Y=1\mid X)\big)=X\beta.$$
AssumptionWhy it mattersIf it fails
Binary outcomeThe Bernoulli likelihood expects labels $0$ and $1$.A multinomial, ordinal, count, or other outcome family is required.
Linear log-odds in the chosen featuresThe score $X\beta$ must represent the logit shape.Justified basis terms, splines, or interactions can represent the missing shape.
No exact multicollinearityCoefficients must be identifiable.Redundant columns need removal or regularization.
No complete separation for unregularized MLEBoth classes need overlap for a finite coefficient solution.Coefficients diverge; regularization or a bias-reduced method restores a finite estimate.
Enough positive and negative eventsRare classes provide little information for many coefficients.Lower complexity, more data, regularization, or a suitable prior may be needed.
Stable class processProbabilities are calibrated only for the population represented in training.Prior or concept shift changes calibration and threshold performance.

Class imbalance is not itself a broken assumption. It changes uncertainty, metric choice, and threshold selection. A well-specified model can still estimate probabilities under imbalance when enough information exists.

What Different Violations Look Like

▶ Six Formula-Derived Assumption Cases

Each step shows a small dataset, the model shape, and the specific conclusion that fails.

What Each Failure Changes

FailureCoefficientUncertaintyPrediction
Wrong mean or logit shapeMisspecified targetMisleadingSystematic errors
Heteroscedastic linear errorsCan remain unbiasedClassical SE is wrongMean prediction may remain useful
Omitted confounderCan be biasedPrecise but wrong is possibleMay fail under intervention or shift
MulticollinearityUnstable or nonuniqueLarge SECan remain stable on familiar support
Logistic separationNo finite unregularized MLEUnstableRanking may look perfect in sample
Population shiftOld relationship may no longer applyTraining intervals irrelevantCalibration and error degrade

A Short Practical Checklist

  1. Outcome: continuous for linear regression, binary for logistic regression.
  2. Feature timing: no value from after the prediction point.
  3. Shape: residual or logit diagnostics show no important missing pattern.
  4. Rank: no exact duplicate columns; condition number is monitored.
  5. Dependence: split and covariance methods match grouping or time order.
  6. Support: deployment rows resemble the training feature region.
  7. Evaluation: metrics, calibration, and thresholds match the real decision.

Common Misconceptions