aalfons / robmedExtra

Shiny apps for (robust) mediation analysis via package robmed
GNU General Public License v3.0
1 stars 1 forks source link

Error when more than 3 mediators in serial model #31

Closed Fdoel closed 1 year ago

Fdoel commented 1 year ago

Currently the app GUI allows users to input more than 3 mediators, but more than 3 mediators are not supported by robmed in the serial case. When you try to run ROBMED with this model, the app just crashes.

Would be good to prevent the user from using the serial model when more than 3 mediators are selected.

aalfons commented 1 year ago

Good catch. Indeed, this kind of exception handling is still missing from the GUI. This also applies to other inputs, for example when a confidence level <0 or > 1 is entered, robmed gives a warning message on the console but then uses the default value, but there should be something that prevents that in the GUI.

There are a number of other issues with these kinds of behavior, but we still have to think about how we want to implement this.

AuroreAA commented 1 year ago

validate and need should be the way to deal with that here

aalfons commented 1 year ago

For the problem with serial mediators, I ended up with a different solution to prevent an error. When the user selects more than three mediators, the input for the type of mediation model disappears, and instead a note or warning is displayed that only the parallel mediator model is implemented for this case. Since we also show a diagram of the selected model now, there should not be any confusion over what the software does.

I will therefore close this issue with the relevant commit, but I'll open a more general issue for other inputs in subsequent tabs.