An ABA Breusch-Pagan calculator asks whether squared residuals from one documented regression vary systematically with a prespecified set of predictors. It begins after the source model has been fitted. The worksheet neither fits that model nor determines whether its clinical interpretation is sound.
Clinicians & ABA Professionals / Data, Outcomes and Clinical Decision-Making.
The question is residual spread, not treatment effectiveness
Use the ABA Breusch-Pagan calculator to expose one residual-variance diagnostic for review. Keep the original observations, fitted values, signed residuals, and residual plots beside the calculation.
The displayed Lagrange multiplier statistic is LM = n * Raux^2, where Raux^2 comes from an auxiliary least-squares regression of squared residuals on the declared explanatory variables and an intercept. A larger result means those auxiliary variables explain more variation in squared residuals under this construction. That number cannot identify why the spread changes, prove heteroscedasticity in every relevant sense, establish a treatment effect, or supply a universal ABA decision boundary.
Freeze the source model and auxiliary design before calculating
The analysis owner should complete the scope record before seeing the diagnostic. Predictors chosen after inspecting residual patterns turn a prespecified check into an exploratory one and must be labeled accordingly.
Scope fieldRequired recordStop signalResponse and unitObservable response, denominator, and stable unitDefinition or unit changedSource regressionFormula, coding, population, phase, and versionResiduals cannot be traced to one fitResidual conventionObserved minus fitted, or another named conventionSigns cannot be reconstructedAuxiliary predictorsColumns chosen before result reviewColumns were selected to alter the resultIntercept ruleInclude a constant in the auxiliary designIntercept handling is absent or inconsistentRow alignmentOne source-model row per auxiliary rowMissing, duplicated, or shifted rowsInclusion rulesVersioned before calculationRows were dropped after viewing the spreadIntended useNamed descriptive diagnostic reviewAutomatic model, treatment, or clinical verdict
Record phase changes, setting changes, staffing changes, schedule changes, measurement revisions, gaps, and clustered observations. A pooled residual calculation can conceal those features.
Preserve every signed and squared residual
The source-model residual is ei = yi - yhati under this page's stated convention. The auxiliary response is e_i^2. Preserve both values so a reviewer can detect sign mistakes, row shifts, and accidental use of absolute residuals.
RowAuthorized row keyObserved y_iFitted yhatiResidual e_iSquared residual e_i^2Auxiliary predictorsPhase or context123...
Do not replace a missing row with an invented value. Do not mix residuals from different fitted models. If observation weights or another residual definition are relevant, stop and obtain method-specific review rather than silently feeding them into this worksheet.
Calculate the auxiliary regression transparently
Fit an ordinary least-squares auxiliary model with ei^2 as the response, the prespecified auxiliary predictors as explanatory columns, and a constant. Let qi be the squared residual, qhati its auxiliary fitted value, and q_bar the mean squared residual.
SSEaux = sum((qi - qhati)^2)
SSTaux = sum((qi - q_bar)^2)
Raux^2 = 1 - SSEaux / SST_aux
LM = n * R_aux^2
The statsmodels Breusch-Pagan documentation describes residual and explanatory-design inputs, reports LM and F forms, and notes that the explanatory matrix should contain a constant. This page displays the LM arithmetic only. P-values, F statistics, and automatic accept/reject results are outside its scope.
Copy the blank diagnostic worksheet
Rowe_i^2Auxiliary fitted qhatiAuxiliary residualSquared auxiliary residualIncluded?Audit note123...
Summary fieldValueRequired noteIncluded rows nMatch source and auxiliary designsAuxiliary columnsInclude coding and interceptq_barMean of included squared residualsSSE_auxFull precisionSST_auxMust be positiveR_aux^2Reproduce from SSE and SSTLM = n * R_aux^2Descriptive diagnostic onlySoftware and variantVersion, settings, and independent check
Carry full precision through the calculation and round only for display. Preserve the analyst, reviewer, date, source-model version, design-matrix version, code or spreadsheet version, and any independently reproduced result.
A fictional eight-row example exposes the arithmetic
Suppose one fictional model produces residuals [1, -1, 1, -1, 2, -2, 3, -3]. A single auxiliary predictor is z = [1, 2, 3, 4, 5, 6, 7, 8], selected before inspecting the result. Squared residuals are [1, 1, 1, 1, 4, 4, 9, 9].
The auxiliary fit is q_hat = -2.0357142857 + 1.2857142857*z.
Rowze_ie_i^2qhatiAuxiliary residual1111-0.75000000001.750000000022-110.53571428570.464285714333111.8214285714-0.821428571444-113.1071428571-2.107142857155244.3928571429-0.392857142966-245.6785714286-1.678571428677396.96428571432.035714285788-398.25000000000.7500000000
Here, qbar = 3.75, SSEaux = 16.0714285714, and SSTaux = 85.5. Therefore Raux^2 = 0.8120300752, and LM = 8 * 0.8120300752 = 6.4962406015.
The first fitted squared residual is negative. That is possible because ordinary least squares does not constrain auxiliary fitted values to be nonnegative. The fitted value is part of a diagnostic projection, not a variance estimate for clinical forecasting.
Robust and original formulations are not interchangeable labels
The current statsmodels documentation defaults robust=True and identifies that result as the Koenker version, which relaxes the normality assumption while retaining an independent and identically distributed error assumption. It describes the original Breusch-Pagan formulation under robust=False.
Record which formulation, software version, exogenous columns, degrees of freedom, and inferential settings were used. This worksheet shows the generic auxiliary n*R^2 construction as a descriptive audit trail. The fictional value is not presented as a reproduction of every software variant, and the worksheet stops before inferential interpretation.
Run implementation and sensitivity checks
CheckExpected arithmetic behaviorLimit of the checkReverse every residual signSquared residuals, R_aux^2, and LM stay the sameResidual provenance may be omittedMultiply residuals by a nonzero constantAuxiliary SSE and SST rescale; R_aux^2 and LM stay the sameUnits are clinically interchangeablePermute residual and predictor rows togetherFit and LM stay the sameObservation order never matters elsewhereScramble only predictor rowsThe estimand and usually LM changeA changed result diagnoses the scramble's causeConstant squared residualsSST_aux = 0; stopEqual absolute residuals validate the modelConstant predictor beyond the interceptAuxiliary design loses informative rank; stopThe column may be ignored without documentationDuplicate or derived predictor columnsRank deficiency requires reviewSoftware output resolves the design problem
These tests assess implementation. They do not validate the source regression, measurement system, sampling plan, independence assumption, or clinical use.
Read the statistic beside residual plots
The NIST residual-variance guidance recommends plotting residuals against explanatory variables and fitted values when checking constant spread. A horn-like pattern can be informative, but nonconstant spread is not the only explanation. An incorrect functional form can also leave structure in residuals.
The broader NIST model-validation guidance treats graphical residual analysis as primary and numerical diagnostics as narrower checks. Review residuals against fitted values, each relevant predictor, order, phase, and clinically meaningful context. Do not let one scalar replace those displays.
Possible follow-up questions include whether the response scale changed, a denominator varied, a nonlinear relationship was omitted, phases were pooled, measurement precision shifted, observations were dependent, or one row has unusual influence. Those are review questions, not conclusions produced by LM.
Stop when the diagnostic design is not defensible
Stop when residuals cannot be traced to one source model, response definitions or units changed, row identity is uncertain, or the auxiliary predictor set was chosen after preferred results were known. Also stop for an omitted intercept, zero squared-residual variance, rank-deficient design, unhandled missingness, pooled phases, or mismatched source and auxiliary rows.
Seek qualified methods review for small samples, observation weights, repeated or clustered records, dependent residuals, nonlinear models, nonstandard residuals, or formal inference. The statsmodels documentation cautions that the LM statistic can exaggerate significance in small or moderately sized samples. This page does not convert that caution into a sample-size cutoff.
Clinical and governance review remains separate
The BACB Ethics Codes page is the current professional source, and the BCBA Test Content Outline includes measurement, data display, interpretation, and experimental design content. The Standards for Educational and Psychological Testing supply broader principles for evidence and interpretation. None endorses this calculator or creates an ABA-specific Breusch-Pagan threshold.
Use synthetic or appropriately de-identified data for training. If identifiable information is necessary in an authorized workflow, minimize fields and use approved storage, access, retention, and version controls. HHS provides separate Privacy Rule and Security Rule summaries. They do not determine applicability or certify a local implementation.
Related resources
- ABA Ordinary Least-Squares Fixed-X Regression Diagnostic Calculator for Clinicians
- ABA Durbin-Watson Ordered-Residual Autocorrelation Diagnostic Calculator for Clinicians
- ABA Ljung-Box Multi-Lag Residual Autocorrelation Diagnostic Calculator for Clinicians
- ABA Phase Level, Trend, Variability and Immediacy Calculator for Clinicians