This ABA Durbin-Watson calculator audits adjacent association in a prespecified ordered sequence of residuals from one documented model. It preserves the residual order, adjacent differences, numerator, denominator and diagnostic value. The result is a model-checking signal. It is not a treatment-effect estimate, a universal randomness test, a time-series model or a clinical decision rule.

Clinicians & ABA Professionals / Data, Outcomes and Clinical Decision-Making.

Model provenance and adjacency

Name the model that produced the residuals before calculating d. State the observed response, fitted value and residual convention, such as et = observedt - fitted_t. Record the ordering key and explain why adjacent rows represent the intended temporal or sequential neighbors. Preserve gaps, phase changes and unequal spacing rather than silently compressing them.

Current statsmodels Durbin-Watson documentation defines the statistic as the sum of squared adjacent residual differences divided by the sum of squared residuals. It describes values nearer 0 as evidence toward positive serial correlation, values nearer 4 as evidence toward negative serial correlation, and 2 as the reference associated with zero lag-one correlation under the stated approximation. NIST autocorrelation plot guidance explains that autocorrelation is one check on randomness and should be examined across lags. NIST autocorrelation documentation defines lagged association and states the equal-spacing assumption. These sources do not create a universal ABA cutoff, validate the source model or justify applying regression-test critical values without the required design conditions.

Professional safeguards come from the BACB Ethics Codes and the measurement and analysis content represented in the BCBA Test Content Outline. Those materials do not prescribe Durbin-Watson. The Standards for Educational and Psychological Testing reinforce the need to connect any interpretation to a documented purpose and evidence base.

Diagnostic specification

Complete this record before viewing the result.

FieldPrespecified entryDiagnostic questionSource model and versionResponse definition and unitsFitted-value definitionResidual conventionOrdering keyEqual-spacing rationaleExpected interval between adjacent rowsMeasurement windowPhase or condition labelsInclusion ruleExclusion ruleMissing-data and gap ruleData version and extraction timeIntended diagnostic useRequired clinical and time-series reviewers

Durbin-Watson uses residuals, not raw outcomes. A raw series can be autocorrelated because of level, trend, seasonality, intervention phases or another structure that a model has not represented. Fitting the model and assessing its clinical and statistical appropriateness are separate tasks.

Ordered residual worksheet

Keep the rows in their prespecified order. The first row has no preceding residual and therefore contributes no adjacent-difference term.

Order keyPhase or contextObserved Y_tFitted YhattResidual e_tPrevious residual e_(t-1)Difference et - e(t-1)Squared differenceSquared residualProvenance or gap note1Not applicableNot applicableNot applicable2345Add rows

Recalculate residuals from the preserved observed and fitted values when possible. Do not paste residuals without their model version and row key. Record an unexpected gap even when the row remains in the sequence. If a phase boundary or long gap means two rows should not be treated as adjacent, stop and define a defensible analysis rather than deleting the boundary after seeing d.

Formula and range checks

For residuals e1, e2, ..., e_T in the fixed order:

numerator = sum from t = 2 to T of (e_t - e_(t-1))^2
denominator = sum from t = 1 to T of e_t^2
d = numerator / denominator

Calculate with unrounded residuals. Round only the display. The first and last residuals each enter one adjacent difference, while interior residuals enter two; all residuals enter the denominator once. When the denominator is positive, exact arithmetic places d between 0 and 4. A value outside that range beyond numerical tolerance indicates an implementation or transcription error.

The common approximation is d approximately 2 * (1 - r1), where r1 is lag-one residual autocorrelation under the specified convention. The approximation is a diagnostic aid, not an identity for every finite sequence. This worksheet does not compute critical values, p-values or a formal decision about serial correlation.

Blank result record

Use this ABA Durbin-Watson calculator as an ordered audit record that stays attached to its source model and plots.

QuantityCalculation or provenanceFull-precision valueDisplay valueResidual count TNumber of ordered residualsAdjacent-pair countT - 1Numeratorsum((et - e(t-1))^2)Denominatorsum(e_t^2)Durbin-Watson dNumerator / denominatorApproximate lag-one correlation1 - d/2Minimum residualPreserved inputMaximum residualPreserved inputMean residualPreserved inputRange check0 <= d <= 4 when definedOrder-reversal checkRecalculate after reversing the entire sequencePositive-rescaling checkRecalculate after multiplying every residual by one positive constant

Attach a residual-versus-order plot and an autocorrelation plot when the design supports them. Mark phase boundaries, missing occasions and changes in measurement conditions. A single statistic cannot show where a run, oscillation, trend or isolated residual occurs.

Fictional worked example

The residuals below are fictional and exist only to demonstrate the calculation. They do not represent a client, treatment, provider or benchmark.

Fictional orderResidual e_tAdjacent differenceSquared differenceSquared residual11Not applicableNot applicable120-1103-1-1114-2-1145-1111601107111182114

The numerator is 7 and the denominator is 12, so:

d = 7 / 12 = 0.5833333333
approximate r_1 = 1 - 0.5833333333 / 2 = 0.7083333333

The relatively low fictional d prompts review for positive adjacent residual association. It does not prove that the residuals follow a specific autoregressive process, that the source model is otherwise valid, or that a clinical action should change. The direct residual plot shows the ordered pattern that the scalar cannot locate.

Reversing the complete residual sequence leaves the same adjacent differences in reverse and produces d = 0.5833333333. Multiplying every residual by 10 multiplies numerator and denominator by 100, so d is unchanged. Those checks support arithmetic integrity, not model validity.

Sequence sensitivity and boundary cases

Diagnostic inputExpected resultBoundary meaningReverse the entire orderd stays the sameAdjacency is preserved under complete reversalMultiply all residuals by a nonzero constantd stays the sameResidual scale cancels in the ratioChange the sign of all residualsd stays the sameGlobal residual direction does not affect dAlternate [1, -1, 1, -1]d = 3Negative adjacent association is suggestedConstant nonzero [1, 1, 1, 1]d = 0Adjacent differences vanish; model adequacy is not establishedAll-zero [0, 0, 0, 0]Undefined because denominator is zeroThere is no residual energy for this ratioArbitrarily sort residuals by sizeValue generally changesPost hoc sorting destroys the prespecified order

Adding a constant to every residual is not an invariance because it changes the denominator while leaving adjacent differences unchanged. Do not recenter residuals merely to move d toward a preferred value. If residuals from a model with an intercept do not sum close to zero, investigate the model, rounding, weighting or extraction rather than silently altering the sequence.

Reading the diagnostic without a universal cutoff

The range from 0 to 4 is descriptive. Values nearer 2 are compatible with lower lag-one residual association under the usual approximation. Values nearer 0 or 4 prompt investigation of positive or negative adjacent association. The statistic is not a universal pass, fail, clinically important or actionable threshold.

Interpretation depends on sample size, model, predictor structure, ordering, spacing, missingness, boundaries and the inferential procedure. This page deliberately does not supply critical-value tables or p-values. A qualified time-series or statistical reviewer should choose any formal analysis and confirm its assumptions before results are known.

A value near 2 does not prove randomness. NIST notes that autocorrelation is only one measure of randomness. Residuals can still show nonlinear structure, changing variance, phase-related patterns, outliers or higher-lag association. Inspect the full diagnostic set and the underlying clinical graph.

Failure modes that stop the calculation

  • Residuals cannot be traced to one documented source model and data version.
  • Row order is uncertain, reconstructed after the fact or sorted by residual size.
  • Gaps, unequal spacing or phase boundaries change the meaning of adjacency.
  • Multiple clients, series, clinicians, classrooms or sites are pooled as one sequence.
  • Observed and fitted values use inconsistent units or residual conventions.
  • The denominator is zero or residuals were rounded so heavily that the calculation is distorted.
  • Rows were excluded, transformed or reordered after inspecting the desired result.
  • The decision requires a time-series model, formal hypothesis test or causal inference.

Preserve the failed record, source observations, fitted values and order. Escalate to qualified clinical and methods review instead of repairing the statistic by hand.

Privacy, security and accessible review

Replace direct identifiers with authorized sequence keys and limit the worksheet to necessary fields. Federal context is available in the HHS Privacy Rule summary and HHS Security Rule summary. Local policy and applicable law control access, storage, transmission, retention and disclosure for the actual record.

Make the ordered table and plots readable without color alone. Label axes and phase boundaries, state units, describe line and symbol encodings, and preserve a machine-readable residual table. Reviewers need the model, order and source data, not only d.

Reviewer questions

  • Is every residual reproducible from a preserved observed and fitted value?
  • Was the model and residual convention fixed before this diagnostic was viewed?
  • Does the ordering key preserve actual adjacency, gaps and phase boundaries?
  • Are residuals from only one defensible series and model?
  • Do the numerator, denominator, range and invariance checks pass?
  • What does the residual-versus-order plot show that d cannot locate?
  • Are higher-lag association, nonlinear structure and changing variance considered separately?
  • Is any formal inference assigned to a qualified methods reviewer rather than inferred from a universal cutoff?
  • Are clinical magnitude and client or caregiver priorities considered apart from this diagnostic?

Related resources

Sources