Hi everyone,
Since my data is not normally distributed, I am not sure if I have used the model correctly, so I want to check here.
I want to perform a mediation analysis with three variables, X, M, and Y, where
X is a binary variable (I set it as a factor variable, as it represents two different conditions in our experiment);
M is a binary variable (I set it as an ordered variable, as 1 represents reward, 0 represents no reward);
Y is a discrete integer (curiosity rated on a 7-point Likert scalee).
I used the following code:
Data <- data.frame(X = X, Y = Y, M = M)
model <- ' # direct effect
Y ~ c*X
# mediator
M ~ a*X
Y ~ b*M
# indirect effect (a*b)
ab := a*b
# total effect
total := c + (a*b)
'
fit <- sem(model, data=Data, estimator='WLSMVS')
summary(fit, nd=5)
Is this the correct way to do?
Thank you so much for your help!