Discussion Forum: Visual Inspection for Heteroscedasticity
When inspecting a scatterplot, subtle error patterns are easy to miss:
Without visual frameworks, it is easy to miss this changing variance (heteroscedasticity) and accept a flawed OLS model.
Figure 1
Connecting the 5th and 95th percentiles highlights the macro-structure of the variance. If the lines are not parallel, variance is not constant.
Figure 2
jamovi does not natively draw quantile boundaries, but you can approximate the upper half of the envelope by plotting the absolute magnitude of the residuals.
1. Save Model Outputs In Analyses > Regression > Linear Regression, under the Save menu, check Residuals and Predicted values.
2. Compute Absolute Residuals Go to the Data tab. Select Compute to create a new variable named Abs_Resid. Use the formula (\(f_x\)): ABS(Residuals).
3. Plot with a Trend Line Navigate to Analyses > Exploration > Scatterplot.
If this smoothed line trends upwards or downwards, the outer boundary of your variance is expanding or contracting, indicating heteroscedasticity.
Divide the horizontal axis into quantiles (e.g., thirds) to directly compare variance ranges across different segments of the data.
Figure 3
To apply the Vertical Slicing method mechanically in jamovi without visual guessing, follow these steps:
1. Save Model Outputs Navigate to Analyses > Regression > Linear Regression. Run your model. Under the Save menu, check the boxes for both Residuals and Predicted values.
2. Find Quantile Cut-Points Navigate to Analyses > Exploration > Descriptives. Move your newly saved Predicted values variable into the variables box. Expand Statistics, check the Percentiles box, and type 33, 66 to find the exact cut values for thirds.
3. Create the Slicing Variable Navigate to the Data tab. Select Compute to create a new variable (name it Tercile). Use a nested IF function (field \(f_x\)) to assign the bins based on the percentiles you found in Step 2 (replace [33rd_percentile_value] and [66th_percentile_value] with the values from Step 2; in ex. 10: \(46.9\), and \(56.7\), respectively): IF(Predicted < [33rd_percentile_value], 'Lower', IF(Predicted < [66th_percentile_value], 'Middle', 'Upper'))
4. Plot the Sliced Variance Navigate back to Analyses > Exploration > Descriptives. Move Residuals into the Variables box and Tercile into the Split by box. Expand Plots and select Box plot. You can now directly compare the vertical spread of the residuals across the three sections.
Plot the square root of the absolute standardized residuals. This folds the plot in half and allows a standard trend line to reveal changes in variance.
Figure 4
You can manually construct a Scale-Location plot using jamovi’s compute functions.
1. Save Model Outputs In Analyses > Regression > Linear Regression, under the Save menu, check Residuals and Predicted values.
2. Compute the Transformation Go to the Data tab. Select Compute to create a new variable named Scale_Location. Use the formula: SQRT(ABS(Residuals)). (Note: While traditional Scale-Location plots use standardized residuals, transforming raw residuals works identically for visually diagnosing variance trends).
3. Plot the Results Navigate to Analyses > Exploration > Scatterplot.
A flat, horizontal smoothed line indicates constant variance. A line with a distinct slope confirms heteroscedasticity.
(Good Pattern) Residuals scattered randomly above and below zero with no trend and roughly constant spread. This confirms linearity, constant variance, and independence.
(Problem Pattern) Residuals spread out as fitted values increase (or decrease). This signals heteroscedasticity. Consider log-transforming the response variable or using weighted least squares.
(Problem Pattern) A systematic curve means the true relationship is nonlinear but you fit a linear model. Add a quadratic term or transform the predictor. This is a model specification problem.
(Problem Pattern) Residuals systematically increase or decrease across fitted values. A relevant predictor is likely missing from the model. Adding it typically removes the trend.
(Investigate) One or a few points sit far from the rest. Large standardized residuals (beyond ±3) warrant investigation. May be an error or a genuinely unusual case.
(Problem Pattern) Residuals cluster into distinct groups rather than distributing evenly. This often indicates a categorical variable (group/time period) was omitted from the model.
Figure 5