jasp-stats / jasp-issues

This repository is solely meant for reporting of bugs, feature requests and other issues in JASP.
58 stars 29 forks source link

Mediation analysis using ordinal mediator terminated unexpectedly #1194

Closed ShaCasis closed 3 years ago

ShaCasis commented 3 years ago

1 Data_FTP and WB JASP.zip

Error in bars[[node]] <- pnorm(GroupThresh$est[GroupThresh$lhs = GroupVars$name[node]]): attempt to select more than one element in integerOneIndex

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)

.medPathPlot(modelContainer, options, ready)

.suppressGrDevice(semPlot::semPaths(object = po, layout = rbind(deps_l, medi_l, pred_l, conf_l), intercepts = FALSE, reorder = FALSE, whatLabels = ifelse(options$plotpars, 'par', 'name'), edge.color = 'black', color = list(lat = '#EAEAEA', man = '#EAEAEA', int = '#FFFFFF'), border.width = 1.5, edge.label.cex = 0.9, lty = 2, title = FALSE, sizeMan = round(8 * exp(-n_totl/80) + 1), legend = options$plotlegend, legend.mode = 'names', legend.cex = 0.6, nodeNames = decodeColNames(po@Vars$name), nCharNodes = 3))

eval(plotFunc, parent.frame())

eval(plotFunc, parent.frame())

semPlot::semPaths(object = po, layout = rbind(deps_l, medi_l, pred_l, conf_l), intercepts = FALSE, reorder = FALSE, whatLabels = ifelse(options$plotpars, 'par', 'name'), edge.color = 'black', color = list(lat = '#EAEAEA', man = '#EAEAEA', int = '#FFFFFF'), border.width = 1.5, edge.label.cex = 0.9, lty = 2, title = FALSE, sizeMan = round(8 * exp(-n_totl/80) + 1), legend = options$plotlegend, legend.mode = 'names', legend.cex = 0.6, nodeNames = decodeColNames(po@Vars$name), nCharNodes = 3)

Steps to reproduce:

  1. Go to SEM

  2. Click on Mediation Analysis

  3. Enter predictor (scale), mediator (ordinal), outcome (scale), and background confounder (2 scale variables)

  4. Scroll down to Options and click: R-squared, total indirect effects, and residual covariances

  5. Scroll down to Plots and click: parameter estimates and legend

  6. Scroll down to Advanced and click under missing value handling: exclude cases listwise and click under emulation: none

  7. See error

vandenman commented 3 years ago

@Kucharssim do you have time to look into this?