Specify a two-condition mediation model
Arguments
- outcome
Named pair of outcome columns, in condition order.
- mediators
Named list of pairs of mediator columns.
- conditions
Two condition names. Defaults to the outcome pair names.
- covariates
List with
betweencolumn names andwithinnamed pairs.- structure
One of parallel, serial, serial_parallel, parallel_serial, or custom. Mediator order matters for predefined serial structures.
- paths
Directed edges using mediator role names and Y, for custom models.
- moderator
NULL or a list with
variable,main_effects,interactions, and optionallyaverage_interactions. Only main_effects = "all_equations" is currently supported. Interactions name edges such as "stress -> Y".
Details
All moderator main effects are explicitly included in all difference
equations. Difference-slope and average-slope interactions are separate.
Categorical between-subject predictors must be unordered factors in the
staged workflow. Use the same explicit factor declaration with wsMed().
Set factor levels explicitly; the first level is the reference group.
See also
wsmed_categorical for supported variable roles and factor coding.