Introduction
Regression models are among the most widely used statistical tools in clinical research. They are used to estimate treatment effects, identify prognostic factors, adjust for baseline covariates, investigate dose-response relationships, and predict clinical outcomes.
But fitting a regression model is only the beginning.
A model can produce coefficient estimates, standard errors, confidence intervals, and p-values while still providing a poor representation of the data.
Regression diagnostics are the process of determining whether the fitted model is appropriate for the data and whether individual observations or structural features of the data are disproportionately affecting the results.
The Linear Regression Model
Consider the standard multiple linear regression model:
where:
- \(Y_i\) is the outcome for subject \(i\).
- \(X_{ij}\) is predictor \(j\) for subject \(i\).
- \(\beta_j\) is the corresponding regression coefficient.
- \(\varepsilon_i\) is the model error.
The fitted value for subject \(i\) is:
The residual is the difference between the observed and fitted outcome:
Most regression diagnostics are ultimately based on understanding these residuals and the relationship between residuals, fitted values, predictors, and individual observations.
What Are the Main Regression Assumptions?
For ordinary least-squares linear regression, the most important assumptions and modeling considerations include:
| Assumption / Issue | What It Means |
|---|---|
| Linearity | The conditional mean of the outcome is correctly modeled as a function of the predictors. |
| Constant variance | The conditional variance is approximately constant across the fitted-value range. |
| Independence | Observations or errors are appropriately independent given the model structure. |
| Normality | The errors are approximately normally distributed when normal-theory inference is being used. |
| No severe multicollinearity | Predictors should not contain problematic linear redundancy. |
| No excessively influential observations | Individual observations should not disproportionately determine the fitted model. |
| Correct specification | Important predictors, interactions, transformations, and nonlinear terms should be appropriately represented. |
Assumption 1: Linearity
The linearity assumption does not mean that every predictor must have a straight-line relationship with the outcome.
Instead, it means that the conditional mean is correctly represented by the model being fitted.
For example:
assumes a linear relationship between \(X\) and the expected value of \(Y\).
If the true relationship is curved, a simple linear term may be inadequate.
Example of Nonlinearity
Suppose change in systolic blood pressure is modeled as a function of age:
If blood pressure increases slowly at younger ages and more rapidly at older ages, the relationship may instead resemble a curve.
A residual-versus-predictor plot can reveal this problem.
Residuals and Fitted Values
The most fundamental regression diagnostic is the residual-versus-fitted plot.
Plot:
A well-behaved residual plot should generally show a pattern resembling a random horizontal cloud centered around zero.
| Residual Pattern | Possible Problem |
|---|---|
| Random cloud around zero | Generally consistent with an adequate mean/variance structure |
| U-shaped curve | Nonlinearity |
| Inverted U-shaped curve | Nonlinearity |
| Increasing spread | Heteroscedasticity |
| Decreasing spread | Heteroscedasticity |
| Distinct clusters | Potential missing grouping variable or dependence structure |
| Isolated extreme points | Potential outliers |
What a Good Residual Plot Looks Like
The idealized pattern is:
Assumption 2: Homoscedasticity
Homoscedasticity means that the conditional variance of the outcome is approximately constant across the relevant predictor or fitted-value range.
In mathematical form:
When the variance changes systematically with the mean, the data are heteroscedastic.
The Classic Funnel Shape
A common diagnostic pattern is a funnel:
- Narrow residual spread at low fitted values
- Increasing residual spread at high fitted values
This suggests that the variance increases as the expected outcome increases.
Residuals Versus Fitted Values for Variance Diagnostics
The residual-versus-fitted plot is useful for assessing both linearity and constant variance.
For example:
| Pattern | Interpretation |
|---|---|
| Constant vertical spread | Consistent with homoscedasticity |
| Fan-shaped spread | Potential increasing variance |
| Reverse fan | Potential decreasing variance |
| Curved mean pattern | Potential nonlinearity |
Scale-Location Plots
A scale-location plot displays approximately:
where \(r_i\) is a standardized or standardized-type residual.
This plot is particularly useful for detecting changes in residual spread.
A roughly horizontal band with relatively stable spread is desirable.
Assumption 3: Normality
Normality is frequently misunderstood.
The assumption is generally about the conditional errors, not about the raw outcome variable itself.
The classical model assumes:
This implies normally distributed residuals when the model is correctly specified.
Normality is particularly relevant for small-sample normal-theory inference.
Q-Q Plots
A normal Q-Q plot compares the ordered residuals with the theoretical quantiles of a normal distribution.
If the residual distribution is approximately normal, the points should lie reasonably close to a straight line.
| Q-Q Pattern | Possible Interpretation |
|---|---|
| Points close to line | Residual distribution approximately normal |
| Heavy tails | Potentially heavier-tailed errors |
| Strong curvature | Skewness or other distributional departure |
| One or more extreme points | Potential outliers |
Q-Q Plots Versus Formal Normality Tests
A formal test such as the Shapiro-Wilk test can be useful, but it should not be the only diagnostic.
With a very large sample, tiny and practically irrelevant departures from normality can produce very small p-values.
With a very small sample, substantial departures can be difficult to detect.
Assumption 4: Independence
Independence means that observations do not contain unmodeled dependence that invalidates the assumed error structure.
This assumption is especially important in clinical research because data are often naturally clustered.
Examples include:
- Repeated measurements from the same patient
- Patients treated at the same clinical site
- Patients nested within physicians
- Patients within geographic regions
- Longitudinal measurements
- Matched subjects
If multiple observations come from the same patient, treating them as independent observations is generally inappropriate.
Independence Is a Study-Design Issue
Independence cannot always be diagnosed from a residual plot.
Knowledge of how the data were generated is essential.
Checking Independence in Ordered Data
For time-ordered observations, residuals can be plotted against time or observation order.
Patterns such as runs, trends, or cycles may indicate dependence.
Autocorrelation can also be examined using an autocorrelation function.
where \(k\) represents the lag.
Assumption 5: Multicollinearity
Multicollinearity occurs when predictors contain substantial linear relationships with one another.
For example, suppose a model includes:
- Weight in kilograms
- Weight in pounds
These variables contain essentially the same information.
Another example is including highly correlated laboratory measurements in the same model.
Why Multicollinearity Matters
Multicollinearity can cause:
- Large standard errors
- Unstable coefficient estimates
- Unexpected coefficient signs
- Strong sensitivity to small data changes
- Difficult interpretation of individual predictor effects
It does not necessarily reduce the predictive performance of the overall model.
Variance Inflation Factor
The variance inflation factor for predictor \(j\) is:
where \(R_j^2\) is obtained by regressing predictor \(X_j\) on all the other predictors.
A large \(R_j^2\) means that predictor \(j\) is highly predictable from the other predictors, resulting in a large VIF.
| VIF | Common Interpretation |
|---|---|
| Approximately 1 | Little or no collinearity |
| 1–5 | Usually modest |
| 5–10 | Potentially concerning |
| >10 | Often considered severe |
These thresholds are rules of thumb rather than universal regulatory standards.
Assumption 6: Outliers
An outlier is an observation whose outcome is unusual relative to what the model predicts.
For example, a patient may have an outcome substantially larger or smaller than expected given the patient's covariates.
Outliers can be identified using:
- Raw residuals
- Studentized residuals
- Standardized residuals
- Q-Q plots
- Residual-versus-fitted plots
Residual Magnitude
A raw residual is:
However, raw residuals are not always directly comparable because their variance can differ across observations.
Standardized or studentized residuals are often more useful for diagnostic purposes.
where \(h_{ii}\) is the leverage for observation \(i\).
Leverage
An observation can be unusual not because its outcome is extreme, but because its predictor values are unusual.
Such an observation can have high leverage.
For example, suppose most patients have ages between 40 and 70 years but one patient is 95 years old.
That patient may have substantial leverage because the patient's predictor profile is far from the center of the predictor space.
Hat Values
Leverage is commonly represented by the diagonal elements of the hat matrix:
The diagonal element \(h_{ii}\) measures how unusual observation \(i\)'s predictor configuration is relative to the other observations.
A common rough screening rule is to investigate observations whose leverage is substantially larger than the average leverage.
Because leverage depends on the number of predictors, rules such as \(2(p+1)/n\) or \(3(p+1)/n\) are sometimes used as screening thresholds.
Influential Observations
An influential observation is one whose presence has a substantial effect on the fitted model.
Influence combines aspects of:
- Residual magnitude
- Leverage
- Model sensitivity
A useful influence diagnostic is Cook's distance.
Cook's Distance
Cook's distance measures how much the fitted regression model changes when an observation is removed.
Conceptually:
where \(\hat Y_{j(i)}\) is the fitted value when observation \(i\) is omitted.
Large values identify observations worthy of investigation.
A commonly used screening rule is:
but this is a heuristic rather than an automatic deletion criterion.
Why Influential Observations Require Clinical Review
Suppose a clinical trial contains one patient with an exceptionally large treatment response.
The observation might be:
- A legitimate biological response
- A measurement error
- A data-entry error
- A protocol deviation
- A genuine but rare patient characteristic
The statistical diagnostic tells you that the observation matters.
It does not tell you whether the observation is wrong.
Residual Diagnostics: A Practical Summary
| Diagnostic | Primary Question |
|---|---|
| Residual vs fitted | Is the mean/variance structure appropriate? |
| Residual vs predictor | Is the relationship with a predictor nonlinear? |
| Q-Q plot | Are residuals approximately normal? |
| Scale-location | Is residual spread approximately constant? |
| Residual vs time/order | Is there evidence of dependence? |
| VIF | Are predictors highly collinear? |
| Leverage | Are predictor values unusual? |
| Cook's distance | Are observations strongly influencing the model? |
A Complete Diagnostic Workflow
Worked Clinical Example
Suppose a clinical study investigates the association between change in a biomarker and change in a clinical outcome.
The proposed model is:
The analyst fits the model and obtains apparently reasonable coefficient estimates.
The next step is not immediately to report the p-values.
The model should first be diagnosed.
Diagnostic Finding 1: Curved Residual Pattern
Suppose the residual-versus-fitted plot shows a pronounced U-shaped pattern.
This suggests that the linear predictor structure may be inadequate.
A possible solution is to add a quadratic term:
Alternatively, restricted cubic splines or another clinically justified nonlinear modeling approach may be appropriate.
Diagnostic Finding 2: Increasing Residual Variance
Suppose residuals become increasingly spread out as fitted values increase.
Potential approaches include:
- Transforming the outcome when scientifically appropriate
- Using heteroscedasticity-consistent standard errors
- Modeling the variance structure explicitly
- Considering a different outcome distribution or model family
The correct solution depends on the scientific objective and the nature of the data.
Diagnostic Finding 3: One Highly Influential Patient
Suppose one patient has a very unusual biomarker value and a very large Cook's distance.
The analyst should first inspect:
- Original laboratory data
- Units
- Data-entry history
- Protocol deviations
- Timing of measurements
- Patient treatment exposure
- Clinical plausibility
If the observation is valid, the primary analysis should generally not simply delete it because it is influential.
A sensitivity analysis can show how much the estimated treatment or biomarker effect changes when the influential observation is included versus excluded under a clearly documented rationale.
Diagnostic Finding 4: High VIF
Suppose the model includes baseline biomarker, change from baseline, and follow-up biomarker.
These variables may be highly correlated.
The resulting VIF values may be large.
Possible solutions include:
- Removing redundant predictors
- Using a clinically meaningful parameterization
- Combining correlated variables
- Using dimension-reduction methods where appropriate
- Reconsidering the scientific question being addressed
Transformations
Transformations can sometimes improve a regression model by making relationships more linear or stabilizing variance.
Common transformations include:
| Transformation | Typical Use |
|---|---|
| \(\log(X)\) | Right-skewed predictors or multiplicative relationships |
| \(\sqrt{X}\) | Moderate right skew or count-like measurements |
| \(X^2\) | Curvature |
| \(1/X\) | Strong nonlinear relationships in specific scientific settings |
| Log outcome | Positive, right-skewed outcomes when scientifically appropriate |
Log-Transforming the Outcome
Suppose the original model is:
A log-transformed model is:
The interpretation of \(\beta_1\) changes substantially.
For a one-unit increase in \(X\), the expected log outcome changes by \(\beta_1\). On the original scale, this corresponds approximately to a multiplicative effect.
Polynomial Terms
A quadratic relationship can be modeled as:
The marginal relationship is:
Therefore, \(\beta_1\) alone is not the overall effect of \(X\).
This is an important reason to plot predicted relationships rather than interpreting polynomial coefficients in isolation.
Interactions Are Also Part of Model Diagnostics
A model may appear nonlinear because an important interaction has been omitted.
For example, treatment effect might differ according to baseline disease severity.
An interaction model could be:
If \(\beta_3\) is clinically meaningful, the treatment effect is not constant across severity levels.
Partial Residual Plots
Partial residual plots can help assess whether the functional form of an individual predictor is appropriate after accounting for the other predictors.
They are particularly useful when a multiple regression model contains several continuous covariates.
However, partial residual plots should be interpreted as diagnostic tools, not as automatic evidence that a particular nonlinear form is correct.
Added-Variable Plots
Added-variable plots, also called partial regression plots, examine the relationship between:
- The residualized outcome
- The residualized predictor
after accounting for the other predictors.
They can help visualize the contribution of an individual predictor to a multiple regression model.
Residuals Should Be Examined on More Than One Scale
A robust diagnostic workflow may examine:
- Raw residuals
- Standardized residuals
- Studentized residuals
- Deleted residuals
Different residual definitions answer slightly different diagnostic questions.
Studentized Residuals
Externally studentized residuals account for the estimated variance after excluding the observation being evaluated.
Large absolute values can indicate observations whose outcomes are unusual relative to the fitted model.
A rough screening convention is to investigate observations with absolute studentized residuals around 2 or 3 or larger.
Formal Tests for Heteroscedasticity
Formal procedures such as the Breusch-Pagan test can be used to investigate heteroscedasticity.
The basic idea is to determine whether the squared residuals are related to the predictors or fitted values.
A significant test can provide evidence against constant variance.
However, as with normality tests, formal tests should be interpreted alongside graphical diagnostics and scientific context.
Breusch-Pagan Test Concept
Suppose:
The test examines whether the error variance depends systematically on predictors.
Conceptually, the squared residuals are modeled as a function of the predictors.
Evidence of a systematic relationship suggests heteroscedasticity.
What About the Durbin-Watson Test?
The Durbin-Watson statistic is commonly used in time-ordered regression settings to investigate first-order autocorrelation.
It is approximately based on:
Values near 2 are generally consistent with little first-order autocorrelation, while values substantially below or above 2 can suggest positive or negative autocorrelation.
However, the appropriate approach for repeated clinical measurements is often a model that explicitly represents within-subject correlation rather than simply applying a Durbin-Watson test.
Regression Diagnostics in R
Suppose a clinical dataset contains:
change_y— change in the clinical outcomechange_x— change in a biomarkerage— baseline agetreatment— treatment group
Fit the model:
fit <- lm( change_y ~ change_x + age + treatment, data = dat ) summary(fit)
Basic Diagnostic Plots in R
par(mfrow = c(2, 2)) plot(fit)
The standard R diagnostic panel provides four particularly useful views:
- Residuals versus fitted values
- Normal Q-Q plot
- Scale-location plot
- Residuals versus leverage
These four plots provide a strong first-pass diagnostic assessment.
Residuals Versus Fitted Values in R
plot( fitted(fit), residuals(fit), xlab = "Fitted values", ylab = "Residuals" ) abline(h = 0)
Look for curvature, changing spread, clusters, and isolated observations.
Normal Q-Q Plot in R
qqnorm( residuals(fit), main = "Normal Q-Q Plot" ) qqline(residuals(fit))
The primary goal is to determine whether the residual distribution is approximately compatible with the normality assumption needed for the intended inference.
Checking VIF in R
Using the car package:
library(car) vif(fit)
Review the VIF values together with the correlation structure and scientific meaning of the predictors.
Influence Diagnostics in R
cooks.distance(fit) hatvalues(fit) rstudent(fit)
Potentially influential observations can be screened using:
which( cooks.distance(fit) > 4 / nrow(dat) )
This is a screening criterion only.
Influence Plot in R
library(car) influencePlot(fit)
An influence plot can simultaneously highlight observations with unusual residuals, leverage, and influence.
Checking Linearity With a Continuous Predictor
plot( dat$change_x, residuals(fit), xlab = "Change in biomarker", ylab = "Residuals" ) abline(h = 0)
A systematic curve suggests that the effect of change_x
may not be adequately represented by a simple linear term.
Adding a Quadratic Term in R
fit_quad <- lm(
change_y ~ change_x + I(change_x^2) +
age + treatment,
data = dat
)
summary(fit_quad)
The revised model should then undergo the diagnostic process again.
Using Restricted Cubic Splines in R
When the relationship is plausibly nonlinear but should remain smooth, spline methods may be preferable to manually selecting polynomial powers.
library(splines)
fit_spline <- lm(
change_y ~ ns(change_x, df = 4) +
age + treatment,
data = dat
)
summary(fit_spline)
The number and placement of knots should be chosen according to a principled modeling strategy rather than adjusted repeatedly until a desired p-value is obtained.
Heteroscedasticity-Consistent Standard Errors in R
If the mean model is appropriate but variance is nonconstant, robust standard errors may be useful.
library(sandwich) library(lmtest) coeftest( fit, vcov = vcovHC(fit, type = "HC3") )
This changes the estimated covariance matrix used for inference while leaving the ordinary least-squares coefficient estimates unchanged.
Checking Normality With Shapiro-Wilk
shapiro.test( residuals(fit) )
The test can be informative, but it should not be used as the sole basis for deciding whether the regression model is acceptable.
Regression Diagnostics in SAS
A standard SAS implementation can use PROC REG for
ordinary linear regression.
proc reg data=dat;
model change_y =
change_x
age
treatment
/ vif
influence
r
clb;
run;
quit;
This requests coefficient estimates, VIF diagnostics, influence diagnostics, and residual-related output.
Residual and Predicted Values in SAS
proc reg data=dat;
model change_y =
change_x
age
treatment;
output out=diag
p=predicted
r=residual
student=student_resid
cookd=cooks_d
h=leverage;
run;
quit;
The resulting dataset can be used to construct diagnostic plots.
Residual-Versus-Fitted Plot in SAS
proc sgplot data=diag;
scatter x=predicted y=residual;
refline 0 / axis=y;
xaxis label="Fitted Values";
yaxis label="Residuals";
run;
Normal Q-Q Plot in SAS
proc univariate data=diag normal;
var residual;
qqplot residual / normal;
run;
Again, the graphical assessment is generally more informative than relying on a single normality p-value.
Checking Multicollinearity in SAS
proc reg data=dat;
model change_y =
change_x
age
treatment
/ vif tol collin;
run;
quit;
This provides VIF, tolerance, and additional collinearity diagnostics.
Influence Diagnostics in SAS
proc reg data=dat;
model change_y =
change_x
age
treatment
/ influence;
output out=diag
cookd=cooks_d
h=leverage
rstudent=student_resid;
run;
quit;
Observations flagged by these diagnostics should be investigated rather than automatically deleted.
What If the Assumptions Fail?
A diagnostic problem does not automatically mean that the entire analysis must be discarded.
The appropriate response depends on the nature of the problem.
| Problem | Potential Response |
|---|---|
| Nonlinearity | Transformation, polynomial terms, splines, or alternative model |
| Heteroscedasticity | Robust SEs, transformation, variance modeling, alternative model |
| Non-normal residuals | Assess severity; consider transformation, robust methods, or another model |
| Dependence | Mixed model, GEE, time-series model, clustered SEs, or other appropriate structure |
| Multicollinearity | Reconsider redundant predictors and scientific estimand |
| Outlier | Verify data and clinical context; conduct sensitivity analysis if appropriate |
| High leverage | Investigate predictor values and assess model sensitivity |
| Influential observation | Verify observation and report sensitivity where appropriate |
Do Not Automatically Delete Outliers
One of the most common mistakes in regression analysis is:
Find an influential observation → delete it → rerun the model.
This is generally inappropriate.
An influential observation may be scientifically important.
Instead, the analyst should ask:
- Is the observation correctly recorded?
- Is the measurement plausible?
- Was the patient eligible?
- Was the treatment administered correctly?
- Was the endpoint assessed correctly?
- Is the observation part of the intended analysis population?
- Does the scientific question require retaining the observation?
Sensitivity Analysis for Influential Observations
If an observation is legitimate but highly influential, a sensitivity analysis can compare the primary analysis with a clearly justified alternative.
fit_all <- lm( change_y ~ change_x + age + treatment, data = dat ) fit_without <- lm( change_y ~ change_x + age + treatment, data = dat[-influential_id, ] ) coef(fit_all) coef(fit_without)
The purpose is not to choose whichever analysis gives the preferred result.
Instead, the comparison shows whether the substantive conclusion depends strongly on the observation.
Model Assumptions Versus Data Assumptions
It is useful to distinguish assumptions about the statistical model from assumptions about the data-generating process.
For example, normality can often be approximately assessed from residuals.
Independence, however, may require knowledge of how subjects were recruited, randomized, measured, and followed.
Regression Diagnostics Are Not Model Selection
Diagnostics and model selection are related but distinct.
Diagnostics ask: Does the fitted model appear compatible with the data?
Model selection asks: Which predictors or functional form should be included?
Using diagnostics to guide scientifically justified model refinement is appropriate.
Repeatedly trying many models solely to find one with favorable p-values is not.
The Danger of Stepwise Modeling
Automated stepwise procedures can produce unstable models, biased coefficient estimates, and overly optimistic p-values.
They also do not replace diagnostics.
A variable being statistically nonsignificant does not necessarily mean it should be removed, particularly when it is a prespecified confounder or important adjustment variable.
Clinical Trial Example: Treatment Effect Adjustment
Suppose the primary model is:
The coefficient \(\beta_1\) represents the adjusted treatment effect under the specified model.
Before interpreting \(\beta_1\), the analyst should assess whether:
- The relationship between baseline and outcome is adequately modeled.
- Residual variance is reasonably stable.
- There are important influential patients.
- There is meaningful dependence not represented in the model.
- The outcome scale is appropriate for linear regression.
Baseline Covariate Nonlinearity
A common clinical-trial problem occurs when a continuous baseline covariate is forced into the model as a linear term without checking whether that relationship is reasonable.
For example:
may be too restrictive if the relationship between age and outcome is curved.
A spline-based adjustment may be more appropriate:
where \(f(\cdot)\) represents a flexible smooth function.
What Diagnostics Cannot Tell You
Regression diagnostics are powerful, but they have limitations.
They cannot automatically determine:
- Whether a causal interpretation is valid
- Whether an omitted confounder exists
- Whether a biomarker is clinically meaningful
- Whether the sample is representative
- Whether the chosen endpoint is scientifically appropriate
- Whether missing data are missing at random
Those questions require study-design knowledge, subject-matter expertise, and additional statistical methods.
Common Mistakes
- Checking only whether p-values are significant. A significant regression coefficient does not establish that the model is appropriate.
- Checking normality of the raw outcome instead of residuals. Regression assumptions concern the conditional error structure.
- Using only formal assumption tests. Plots often reveal important patterns that a formal test does not adequately describe.
- Deleting outliers automatically. An unusual observation may be valid and clinically important.
- Using VIF as an automatic variable-deletion rule. Collinearity must be interpreted in the context of the scientific model.
- Ignoring the study design. Repeated or clustered observations require appropriate modeling.
- Using robust standard errors to fix every problem. Robust SEs do not correct misspecified mean relationships.
- Transforming variables solely to improve plots. Transformations change interpretation and should have a defensible rationale.
- Ignoring influential observations. Even if an observation is valid, its influence may be important for interpreting the robustness of the results.
- Running diagnostics only after seeing an unfavorable result. Diagnostics should be part of the planned analysis workflow rather than a post-hoc search for a preferred model.
A Practical Diagnostic Decision Tree
Reporting Regression Diagnostics
A statistical report does not need to reproduce every diagnostic plot ever generated.
Instead, it should describe the important findings and how they affected the analysis.
For example:
When Diagnostics Lead to a Different Model
Sometimes the correct conclusion is that ordinary linear regression is not the appropriate model.
Examples include:
| Outcome / Structure | Potential Model |
|---|---|
| Binary outcome | Logistic regression |
| Count outcome | Poisson or negative binomial regression |
| Excess zeros | Zero-inflated or hurdle models |
| Repeated continuous measurements | Linear mixed model or GEE |
| Time-to-event outcome | Cox or parametric survival model |
| Ordinal outcome | Ordinal regression |
| Bounded continuous outcome | Potentially transformed or specialized model |
The purpose of diagnostics is therefore broader than checking a list of assumptions.
They help determine whether the selected model is appropriate for the type of data and scientific question.
Diagnostics for Logistic Regression Are Different
The concepts in this tutorial primarily describe ordinary linear regression.
Logistic regression has a different conditional distribution and does not assume normally distributed residuals in the same way.
Nevertheless, diagnostics remain essential.
Relevant logistic-regression diagnostics include:
- Linearity of the logit for continuous predictors
- Influential observations
- Leverage
- Deviance residuals
- Pearson residuals
- Calibration
- Discrimination
- Separation
Diagnostics for Count Regression
For Poisson regression, a key concern is whether the conditional variance is compatible with the Poisson assumption.
The Poisson model assumes:
If the variance is substantially larger than the mean, overdispersion may be present.
This may motivate a negative binomial model or another approach.
The Bigger Principle
Regression diagnostics should be thought of as a process of model criticism.
You start with a scientifically motivated model.
Then ask:
- Does the model capture the mean relationship?
- Does the variance behave as expected?
- Are observations appropriately independent?
- Are the residuals reasonably compatible with the assumed distribution?
- Are predictors redundant?
- Are individual observations disproportionately influential?
- Does the model make clinical sense?
The answer to these questions determines whether the model should be retained, modified, or replaced.
Final Diagnostic Checklist
| Question | Diagnostic |
|---|---|
| Is the mean relationship adequately represented? | Residual vs fitted and residual vs predictor plots |
| Is variance approximately constant? | Residual vs fitted and scale-location plots |
| Are residuals approximately normal? | Q-Q plot and, where useful, formal tests |
| Are observations appropriately independent? | Study design, ordering, clustering, autocorrelation diagnostics |
| Are predictors strongly redundant? | Correlation structure and VIF |
| Are outcomes unusual? | Standardized/studentized residuals |
| Are predictor values unusual? | Leverage |
| Do observations strongly affect the model? | Cook's distance and influence diagnostics |
| Does the model remain scientifically interpretable? | Clinical and subject-matter review |
Recommended R Workflow
# Fit model fit <- lm( change_y ~ change_x + age + treatment, data = dat ) # Basic model summary summary(fit) # Standard diagnostic panel par(mfrow = c(2, 2)) plot(fit) # VIF library(car) vif(fit) # Studentized residuals rstudent(fit) # Leverage hatvalues(fit) # Cook's distance cooks.distance(fit) # Influence plot influencePlot(fit)
Recommended SAS Workflow
proc reg data=dat;
model change_y =
change_x
age
treatment
/ vif
influence
r;
output out=diag
p=predicted
r=residual
student=student_resid
cookd=cooks_d
h=leverage;
run;
quit;
proc sgplot data=diag;
scatter x=predicted y=residual;
refline 0 / axis=y;
run;
proc univariate data=diag normal;
var residual;
qqplot residual / normal;
run;
What Should Go Into the Statistical Analysis Plan?
When regression is a prespecified primary or key secondary analysis, the SAP should describe the modeling strategy clearly enough that the analysis does not become an informal search for a favorable model.
Relevant documentation may include:
- Primary outcome definition
- Primary regression model
- Prespecified covariates
- Functional form of continuous covariates
- Important prespecified interactions
- Handling of categorical variables
- Approach to missing data
- Approach to influential observations
- Diagnostic procedures
- Criteria for model modification, if applicable
- Sensitivity analyses
- Methods for nonconstant variance or dependence
How to Think About a Diagnostic Plot
A diagnostic plot is not asking:
"Does this look perfectly random?"
Instead ask:
- Is there a systematic structure?
- Is that structure large enough to matter?
- Does it affect the scientific conclusion?
- Is the pattern caused by a small number of observations?
- Is there a clinically plausible explanation?
- Would another model describe the data more appropriately?
No real dataset will satisfy every theoretical assumption perfectly.
The goal is to determine whether departures are sufficiently important to change the analysis or interpretation.
The Most Important Concept
Regression diagnostics are not about making a dataset look perfect.
They are about determining whether the fitted model is a reasonable representation of the data for the question being asked.
A good regression workflow therefore looks like:
References
Fox, J. & Weisberg, S. An R Companion to Applied Regression.
Sage Publications.
Kutner, M.H., Nachtsheim, C.J., Neter, J. & Li, W. Applied Linear Statistical Models.
McGraw-Hill.
Montgomery, D.C., Peck, E.A. & Vining, G.G. Introduction to Linear Regression Analysis.
Wiley.
Harrell, F.E. Regression Modeling Strategies.
Springer.
Weisberg, S. Applied Linear Regression.
Wiley.
Chatterjee, S. & Hadi, A.S. Regression Analysis by Example.
Wiley.