medXMY: Run Tests of Normative Simple Mediation Pathways of Total...

View source: R/medXMY.R

medXMYR Documentation

Run Tests of Normative Simple Mediation Pathways of Total X->Y Relationship (no Moderators)

Description

This will run and extract single-mediator mediation models ('Model 1' in Wood, Harms, & Cho, 2023) for all measured potential mediators of the [X->Y] association.

Usage

medXMY(data, X, Y, jSet, all = F)

Arguments

data

dataset in a PSI long format

X

the initiating variable

Y

the dependent variable (often "likelihood" - but not necessarily)

jSet

location of the set of variables that will be explored as moderated by Z

all

include the full lavaan results for each variable (default to F)

Details

This adjusts for degrees of freedom by using 'p' as a clustering variable in lavaan

Note that this model is referred to as the 'Minimal EV Model' in Wood et al., 2023, and will produce a simple mediational model that is equivalent to the common c = a*b + c formula found in mediational models, but using a different notation - specifically B0_YX = B1_MX*B1_YM + B1_YX.

The B0_YX is returned as a bit of a quality check. If the estimates, p values, etc, are not isn't the same across all cases, then this indicates that you did not get rid of cases with missing values, which is generally recommended.

Value

Will return the normative forces along the mediational pathway, separately for each potential mediator.

Will also return a summary that can be used to quickly glance the estimates of indirect pathway and its statistical significance.


Dustin-Wood/funfield documentation built on July 20, 2023, 7:10 a.m.