Skip to content

Add residual plots - #231

Open
JohnnyDoorn wants to merge 9 commits into
jasp-stats:masterfrom
JohnnyDoorn:feature/residual-plots
Open

JohnnyDoorn wants to merge 9 commits into
jasp-stats:masterfrom
JohnnyDoorn:feature/residual-plots

Conversation

@JohnnyDoorn

@JohnnyDoorn JohnnyDoorn commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

predicted vs residuals and q-q plot

for Bayesian version (same style as BANOVA)
image

JohnnyDoorn and others added 8 commits November 2, 2026 21:10
Adds "Residuals vs. predicted" and "Q-Q plot standardized residuals" to
each model in the classical and Bayesian Process analysis, with a "Set
for All Models" default under Advanced. The plots are shown for every
dependent variable of a model (the outcome and each mediator), so users
can check the homoscedasticity and normality assumptions of each
regression equation without refitting it in Linear Regression.

Predicted values are computed from the parameter table, because
lavPredict(type = "yhat") returns the observed values for models without
latent variables. Standardized residuals use the estimated residual
variance; Bayesian models use the posterior means.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picks up the Q-Q plot fixes: the confidence band follows the drawn
y = x line (jasp-stats#167), and missing values are dropped before the quantiles
are computed (jasp-stats#169).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds "Confidence interval" under "Q-Q plot standardized residuals" in
the classical analysis, as in Linear Regression, ANOVA and the t-tests:
a nested qqPlotCi checkbox with a qqPlotCiLevel field, passed as ciLevel
to jaspGraphs::plotQQnorm, plus its "Set for All Models" default under
Advanced. The Bayesian analysis hides the option, like the other
Bayesian analyses, whose Q-Q plots have no band.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shows the "Credible interval" option under "Q-Q plot standardized
residuals" in the Bayesian analysis (the same qqPlotCi/qqPlotCiLevel
options as the classical confidence band), plus its "Set for All Models"
default. As in Bayesian ANOVA, the standardized residuals are computed
for each posterior draw: the points are their posterior means and the
error bars their central credible intervals. The points previously used
the posterior means of the parameters; the two differ by about 0.02 on
the standardized scale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bootstrapped standard errors / confidence intervals and bootstrapped local
tests were not reproducible. Adds SetSeed {} under Options and seeds each
model's bootstrap and local tests, so results do not depend on which models
were refitted in a run. seed/setSeed were already in .procGetDependencies().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… changes

bootstrapSamples was in no dependency list, so changing Replications kept the
previous bootstrap. Adds it to .procGetDependencies(), next to
errorCalculationMethod and bootstrapCiType.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JohnnyDoorn

Copy link
Copy Markdown
Contributor Author

About the failing unit-tests checks

All four jobs fail in "Set up the test environment" while restoring dependencies, before any test runs. This is not caused by this PR. Master's scheduled run fails at the same step (every week since at least 2026-08-31), and so do the other modules (jaspRegression, jaspSem, jaspAnova, ...). Fixes are underway in jasp-stats/jasp-actions#89, jasp-stats/jaspTools#88 and jasp-stats/jasp-actions#78.

Local run of the full test suite on b101254 (macOS arm64, R 4.5.2, renv lockfile, NOT_CRAN=true):

Test file Tests Failed
test-bayesian-process-general.R 3 0
test-bayesian-process-integration.R 16 2
test-bayesian-process-unit.R 1 0
test-classic-process-hayes-models-with-bad-variable-names.R 16 0
test-classic-process-integration-custom-models.R 18 0
test-classic-process-integration-general.R 35 0
test-classic-process-integration-hayes-models.R 94 0
test-classic-process-unit.R 56 0
test-classic-process-verification.R 2 0
Total 241 2

The two failures ("model number 10 - continuous" and "model number 10 - factor", 9 expectations) fail in the same way on master, so they are unrelated to this PR. They are MCMC reference values that differ on this machine, and that file is skipped on CI. The 228 warnings are also the same as on master.

Once those CI fixes are in, jaspProcess will likely need a separate lockfile update: later 1.4.5 does not compile on the Ubuntu 26.04 runner, the rstan binary needs a newer RcppParallel than 5.1.11-1, and blavaan 0.5-10 fails to build from source on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants