Why Diagnose Regressions Within Patterns?
A regression fitted within a dropout pattern describes the relationship between outcomes and covariates among subjects in that pattern. Its residuals—the differences between observed and fitted outcomes—can reveal whether the chosen mean structure is missing curvature, whether residual variability changes across the fitted range, or whether a small number of subjects are unusually influential. These checks matter because a regression can produce numerical estimates even when its form represents the observed data poorly.
The unit of diagnosis is the pattern-specific fit. Residuals from different patterns need not have the same mean structure, variance, or range, so a plot that combines them can hide a problem in one pattern or create an apparent problem that belongs only to differences between patterns. In longitudinal data, measurements from the same subject are also related. Diagnostics should therefore respect the regression's working covariance structure rather than treating every observed visit as an independent subject.
Model and Residual Definitions
Let \(r\) index a dropout pattern, \(i\) a subject in pattern \(r\), and \(t\) an observed visit for that subject. A pattern-specific linear regression for the observed outcome can be written as
Here \(x_{irt}\) is a vector of covariates (including an intercept if appropriate), \(\beta_r\) is the regression coefficient vector for pattern \(r\), and \(\varepsilon_{irt}\) is the error. The mean-model assumption is \(E(Y_{irt}\mid x_{irt},r)=x_{irt}^{\mathsf T}\beta_r\). For inference based on a specified covariance model, the errors must also have the modeled within-subject covariance, and subjects must be independent of one another conditional on the modeled information. These assumptions concern observed outcomes within the pattern; they do not imply anything about the unobserved outcomes of subjects who dropped out.
Stack the observed outcomes for pattern \(r\) into \(y_r\), their design rows into \(X_r\), and use a generalized least-squares fit if a within-subject covariance matrix \(V_r\) is specified. The fitted vector is \(\hat y_r=X_r\hat\beta_r\), and the raw residual vector is \(e_r=y_r-\hat y_r\). Under ordinary least squares (OLS), \(V_r\) is proportional to the identity matrix. Under generalized least squares (GLS), the fitting procedure uses \(V_r\) to account for dependence and possibly unequal variances.
The factor \(1-h_{jj}\) matters because fitted values are constrained by the data used to estimate the coefficients: residuals at high-leverage rows tend to have smaller variance. For GLS or correlated longitudinal data, a marginal residual's variance depends on both the covariance model and the fitted-value uncertainty. Use a standardization appropriate to that fit, or inspect covariance-adjusted (whitened) residuals; do not apply the independent-error OLS formula mechanically to repeated measurements.
What to Look For
Begin with residuals against fitted values and against important continuous predictors, especially visit time. A useful mean model should leave residuals centered near zero without a systematic pattern. A smooth curve or repeated bend suggests that the fitted mean may be missing a nonlinear term, interaction, or time-specific structure. Random scatter is supportive, not proof, of an adequate mean model.
To assess variance, look for changes in the vertical spread of residuals over fitted values, predictors, or visits. A fan shape—residuals becoming more dispersed as fitted values increase—can indicate heteroscedasticity. In longitudinal data, compare spread by visit as well: a constant variance across visits may be implausible even when the residual-versus-fitted plot looks unremarkable. Use a plot that preserves the pattern and subject structure, and consider subject-level summaries or covariance-adjusted residuals when repeated observations are present.
Influence concerns how much a fitted regression changes when a subject or observation is removed. Leverage measures how unusual a design row is in predictor space; a large residual measures disagreement with the fitted outcome. A row with high leverage but a small residual may not strongly distort the fit, and a large residual at an ordinary design point may be discordant without being highly influential. For longitudinal regressions, assess influence at the subject level as well as at the visit level: deleting one subject removes all that subject's observed visits.
Worked Example: Detecting Curvature Within a Pattern
Suppose a hypothetical pattern-specific regression predicts symptom score from visit number \(t\), using a straight line \(\hat Y=10+2t\). The observed scores at visits \(t=0,1,2,3,4\) are \(10,13,14,13,10\), respectively. Assume these are five subjects with one observed score each, so the independence issue does not arise in this small illustration.
The fitted scores are \(10,12,14,16,18\). Thus the residuals, calculated as observed minus fitted, are \(0,1,0,-3,-8\). For example, at \(t=4\), \(e=10-(10+2\cdot4)=-8\).
The residuals are positive around \(t=1\) and sharply negative at later visits; they do not fluctuate around zero without structure. This pattern is consistent with a mean model that misses curvature or another time-specific feature. It does not establish which alternative model is correct. A next step would be to examine a scientifically sensible nonlinear time term or visit-specific means, refit within this pattern, and check whether the structure remains in the new residual plot.
Worked Example: Comparing Residual Spread
In a hypothetical pattern-specific fit, suppose standardized residuals for observations with fitted scores below 20 have values \(-1,0,1,2,-2\), while those with fitted scores of at least 20 have values \(-3,3,-4,4,-2\). Assume the regression and standardization are appropriate for the observed data, and treat these values as an exploratory illustration rather than a formal variance test.
The first group's mean is \(0\), and its sample variance is \[ s_1^2=\frac{(-1)^2+0^2+1^2+2^2+(-2)^2}{5-1} =\frac{10}{4}=2.5. \] The second group's mean is also \(0\), and its sample variance is \[ s_2^2=\frac{(-3)^2+3^2+(-4)^2+4^2+(-2)^2}{5-1} =\frac{54}{4}=13.5. \] The estimated variance ratio is \(13.5/2.5=5.4\). The much wider spread in the higher-fitted group is a warning that residual variance may increase with the fitted outcome. With only five observations per group, this ratio is noisy; it is a prompt to inspect the plot and consider an appropriate variance model, not conclusive evidence by itself.
Influence and a Short Justification
For an OLS fit, the hat matrix \(H\) maps observed outcomes to fitted values, \(\hat y=Hy\). Its diagonal \(h_{jj}\) is leverage for row \(j\). For a regression with \(p\) coefficients and \(n\) fitted rows, a commonly used Cook's distance is
This combines residual size and leverage. It is a screening measure, not a hypothesis test with a universal cutoff. In longitudinal work, a subject-deletion comparison is often more directly relevant: refit after removing subject \(i\), then compare the coefficient vector with the original fit. One dimensionless summary is
where \(\hat\beta_{r(-i)}\) is the estimate after deleting subject \(i\). A large value signals a substantial change relative to estimated coefficient uncertainty. This check is meaningful only if the covariance estimate is invertible and both fits are estimable; otherwise, the summary itself is unstable.
The OLS standardization follows from a short variance calculation. If errors are independent with variance \(\sigma^2\), then \(e=(I-H)\varepsilon\), because \(HX=X\) removes the fitted mean. Since \(H\) is symmetric and idempotent,
Replacing \(\sigma\) by the residual estimate \(s\) gives the internally studentized residual formula. This derivation also explains why the formula relies on the OLS error assumptions: with correlated repeated measures, \(\operatorname{Var}(e)\) is not generally \(\sigma^2(I-H)\).
Worked Example: A High-Influence Observation
Consider a hypothetical OLS regression within one pattern, with five subjects and one outcome per subject. The predictor values are \(x=0,1,2,3,4\), and the outcomes are \(Y=10,13,14,13,20\). The fitted line is \(\hat Y=10+2x\), giving residuals \(0,1,0,-3,2\). Their sum and their predictor-weighted sum are both zero, as required for an OLS line with intercept: \(0+1+0-3+2=0\) and \(0+1+0-9+8=0\).
The residual sum of squares is \(0^2+1^2+0^2+(-3)^2+2^2=14\), so \(s^2=14/(5-2)=4.667\). Here \(\bar x=2\), \(\sum(x-\bar x)^2=10\), and the leverage at \(x=4\) is \[ h_{jj}=\frac{1}{5}+\frac{(4-2)^2}{10}=0.6. \] For that observation, Cook's distance is \[ D_j=\frac{2^2}{2(4.667)}\frac{0.6}{(1-0.6)^2} \approx 1.607. \] This value flags the endpoint as potentially influential in this small example. It does not justify deleting the subject. Check the underlying record, compare the coefficient estimates with and without the subject, and assess whether the endpoint is scientifically plausible. The tiny sample also makes all diagnostics and the fitted line highly uncertain.
Diagnostics in Context: Assumptions, Alternatives, and Limits
State the outcome, predictors, mean structure, and any working covariance model. Do not treat observations from different dropout patterns as if they necessarily shared one regression.
Plot residuals against fitted values, continuous predictors, and visit. Look for systematic location changes, curvature, and changing spread; use covariance-adjusted residuals when the repeated-measures model requires them.
Review high-leverage rows and subject-deletion changes. Verify data and model specification, then report whether conclusions depend materially on the flagged subject or observation.
These diagnostics complement, but do not replace, checks of distributional fit within each pattern. Residual plots focus on the regression's conditional mean, variance, and influential cases; distributional checks address other aspects of the fitted outcome distribution. A formal heteroscedasticity test can supplement plots under its own assumptions, but a test does not identify the cause of changing spread and may have little power in a small pattern.
When a pattern has few subjects, plots can be dominated by individual observations and influence calculations can be unstable. That is a reason to report uncertainty and avoid overinterpreting apparent structure, not a reason to ignore a conspicuous point. The next step may be a simpler model, sensitivity analysis, or explicit acknowledgment that the pattern-specific regression is weakly supported. Residuals are also limited to observed outcomes: they cannot verify the regression's predictions for visits that are missing after dropout or establish a missingness mechanism.
Common Pitfalls
- Pooling residuals across patterns. Different pattern-specific fitted means or variances can make a pooled plot misleading. Inspect each fitted regression in its own pattern first.
- Using independent-error standardization for repeated observations. Correlation changes residual variances. Use a standardization compatible with the fitted covariance model.
- Equating a large residual with influence. Influence depends on the design as well as residual size. Check leverage or refit after deleting the subject.
- Deleting a flagged observation automatically. A diagnostic identifies sensitivity, not an error. Verify the record, examine model fit, and report relevant sensitivity.
- Interpreting a clean plot as proof. Limited sample size can obscure problems, and no observed-data diagnostic validates assumptions about outcomes that were not observed.
Check Your Understanding
Answer each question, then compare with the solutions below.
- In a pattern-specific regression, residuals are mostly positive at early visits and mostly negative at later visits. What model feature should be investigated?
- A residual-versus-fitted plot has a widening fan. What does this suggest, and what does it not establish?
- Why is an observation with a large residual not necessarily the most influential observation?
- A subject has three observed visits in a pattern. Why can deleting the whole subject be more informative than deleting one visit when assessing influence?
Solutions. (1) The pattern suggests the conditional mean may not capture the time trend; investigate curvature, visit-specific means, or another scientifically defensible time structure, then reassess the residuals. (2) The widening spread suggests nonconstant residual variance over the fitted range. It is a diagnostic warning, not proof of a particular variance mechanism or a formal conclusion from a small plot. (3) Influence depends on both residual size and leverage, and in longitudinal data also on the subject's set of design rows. A large residual at an ordinary design point may have little effect on the coefficient estimates. (4) Removing the whole subject measures how much the pattern-specific fit changes when that independent sampling unit is excluded; deleting one visit leaves the subject's other correlated outcomes in the fit and answers a different question.