Skip to content

[Bug]: SEM mediation bug #3692

@Joshnneal

Description

@Joshnneal

JASP Version

0.95.1

Commit ID

No response

JASP Module

SEM

What analysis are you seeing the problem on?

Mediation

What OS are you seeing the problem on?

macOS Silicon

Bug Description

Attempted to bootstrap a mediation analysis for my dataset (attached) utilizing the following options:
jaspSem::MediationAnalysis(
data = NULL,
version = "0.95",
bootstrapCiType = "percentileBiasCorrected",
bootstrapSamples = 1000,
ciLevel = 0.95,
confounds = ~ ANT_Correct_Total + Age + Sex + Medication,
emulation = "lavaan",
errorCalculationMethod = "bootstrap",
estimator = "default",
mediators = ~ R/S_LC_right,
naAction = "fiml",
outcomes = ~ ANT_RT_Alerting_Effect,
pathCoefficient = TRUE,
pathPlot = FALSE,
pathPlotLegend = FALSE,
pathPlotParameter = FALSE,
plotHeight = 320,
plotWidth = 480,
predictors = ~ IRR,
rSquared = FALSE,
residualCovariance = TRUE,
standardizedEstimate = TRUE,
standardizedEstimateType = "all",
syntax = TRUE,
totalIndirectEffect = TRUE)

Then received the following error message:
Error in if (var(t) = 0) {: missing value where TRUE/FALSE needed

Stack trace
tryCatchOne(expr, names, parentenv, handlers[[1]])

doTryCatch(return(expr), name, parentenv, handler)

withCallingHandlers(expr = analysis(jaspResults = jaspResults, dataset = dataset, options = options), error = .addStackTrace)

analysis(jaspResults = jaspResults, dataset = dataset, options = options)

.medParTable(modelContainer, dataset, options, ready)

lavaan::parameterestimates(fit, level = options[['ciLevel']], boot.ci.type = bootstrapCiType)

I am concerned with what is going on, as well as if this reflects issues with the non-bootstrapped estimates of the indirect effects.

BS_3.6_OALC.csv

Expected Behaviour

Ideally, bootstrapping for the model intended.

Steps to Reproduce

  1. Enter the mediation analysis
  2. Set the variables as noted above
  3. Select Standardized Estimates
  4. Select the Bootstrapping Option

Log (if any)

No response

More Debug Information

-------- Application Info --------
JASP Version: JASP 0.95.1 (Apple Silicon)
Build Branch: development
Build Date: Aug 20 2025 12:37:17 (Netherlands)
Last Commit: 180d14c18d13c107ee7c16b0993ff7e1cc02680b

-------- Basic Info --------
Operating System: macOS Sequoia (15.6)
Product Version: 15.6
Kernel Type: darwin
Kernel Version: 24.6.0
Architecture: arm64
Install Path: /Applications/JASP.app/Contents/MacOS
Platfotm Name: cocoa
System Local: en_US

Final Checklist

  • I have included a screenshot showcasing the issue, if possible.
  • I have included a JASP file (zipped) or data file that causes the crash/bug, if applicable.
  • I have accurately described the bug, and steps to reproduce it.

Metadata

Metadata

Assignees

Labels

Bug: HighBugs that are negatively affecting the area of the program, but don't need immediate fix.Module: jaspSem

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions