Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Snapshots need re-recording, and smoother scaling and all-NA subtitle cases remain unresolved.
1 open issue
What changed in this PR
This PR keeps the outliers panel y-axis bounded by standardized residuals instead of Cook’s distance contours.
Changes:
- Clips contours and adjusts labels/subtitles.
- Preserves residual scaling when dots are hidden.
- Adds regression tests and updates NEWS/version metadata.
| File | Summary |
|---|---|
R/plot.check_outliers.dots.R |
Implements contour clipping and residual-based scaling. |
tests/testthat/test-check_outliers_y_axis.R |
Tests axes, contours, labels, subtitles, and sampling. |
tests/testthat/test-check_model_show_smooth.R |
Updates contour expectations. |
NEWS.md |
Documents the behavior change. |
DESCRIPTION |
Bumps the package version. |
Review effort: Lite
Cut the Cook's distance contour lines where they leave the range of the standardized residuals, so that the lines no longer stretch the y axis as the number of observations grows (easystats/performance#894). Labels of cut lines move to the inner side of the line, or to the largest leverage when the line does not reach 80% of the leverage range. The subtitle says when no line is inside the residual range.
Without dots, a blank layer keeps the y axis on the residual range, so the contour lines are still cut there and drawn. The subtitle says that all points are inside only if the contour lines could be computed, and a cut line of a single point is dropped. The new tests skip on CRAN and without ggrepel.
…points are inside, and reword two test comments
…oints are inside Rows left out by the sampling above maximum_dots can lie between contour levels, so the subtitle now also needs every Cook's distance below the smallest level. The show_smooth test checks that the remaining contour line is the upper one and skips on CRAN. The ggrepel skip now covers only the tests of the y range with point labels.
3104192 to
4544d45
Compare
|
# Conflicts: # DESCRIPTION
|
I have uploaded some updated snapshots for comparison.
|
|
Sorry, we should close this PR without merging. I thought this would help easystats/performance#894, but the LOESS changes fixed that and this isn't necessary. |

In the outliers panel of
check_model()andplot()forcheck_outliers(), the Cook's distance contour lines set the y axis, so it grew with the number of observations (easystats/performance#894, #464). For anlm()with 400 observations and residuals from -2.7 to 3.6, the axis went from about -21 to 21. The axis now follows the residuals, and the contour lines are cut at their range. If no line is left in the panel, the subtitle says that all points are inside the contour lines.The snapshots that show this panel are not re-recorded here, because they already fail on main on my machine (local package versions). They need a re-record in CI:
Refs easystats/performance#894