Replicating Edwards & Lambert (2007)'s Total Effect Model

780 views
Skip to first unread message

tom...@rhsmith.umd.edu

unread,
Apr 6, 2016, 10:22:55 PM4/6/16
to lavaan


Dear All,

I'm trying to replicate Edwards & Lambert (2007)'s empirical example analysis which they did in SPSS and Excel (for God knows what reason). Model goes like this: X is feedback, M is satisfaction, Z is centrality and Y is commitment. Z moderates the a path (from X to M), the b path (from M to Y) and the cprime direct path (from X to Y). Essentially Z (centrality) moderates every possible link in the model, therefore the name total effect model. 

I've been trying to write code using lavaan to fit this model. But I keep getting errors. I really appreciate someone helping me out. Thanks guys! The mean centered data looks like this. Ignore gender for now. 

Here's my code:

model=
'##path from X (Feedback) to M (Satisfaction)

Satisfaction~b1*Feedback+b2*Centrality+b3*Feedback*Centrality

##path from X (Feedback)to Y(Committment) (b4-b6 represents the direct effect moderation and b7-b8 represent the path from Sat to Commitment )

Commitment~b4*Feedback+b5*Centrality+b6*Feedback*Centrality+b7*Satisfaction+ b8*Satisfaction*Centrality

##indirect effect, first define a and b and then define product term
a:= b1+b3*Centrality
b:= b7+b8*Centrality 
ab:= a*b

##direct effect
cprime:= b4+b7*Centrality

##total effect
total:=cprime+ab
'

And the error message is "Error in lav_partable_constraints_def(partable, con = LIST, debug = debug) : 
  lavaan ERROR: unknown label(s) in variable definition(s): b3 Centrality b8"

Edward Rigdon

unread,
Apr 6, 2016, 10:31:52 PM4/6/16
to lav...@googlegroups.com
I don't believe lavaan's new parameter command works this way. A new parameter must be a function of other parameters (which are not themselves new parameters). The program is assuming that your variable label "Centrality" is part of a label identifying another parameter.  They are not, hence the error message.
--Ed Rigdon

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.

Terrence Jorgensen

unread,
Apr 7, 2016, 3:31:25 AM4/7/16
to lavaan
A new parameter must be a function of other parameters (which are not themselves new parameters). 

User-defined parameters can be functions of other user-defined parameters, such as calculating a total effect from indirect and direct effects:

set.seed(1234)
X <- rnorm(100)
M <- 0.5*X + rnorm(100)
Y <- 0.7*M + rnorm(100)
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 + ab
'
fit <- sem(model, data = Data)
summary(fit)

But Ed is right that you can't create a user-defined parameter as a function of a variable.  Modeling an interaction requires you to create product terms in your data set and include those as separate variables.  To probe the interaction (i.e., test the indirect effect at different levels of the moderator), you will have to create user-defined parameters for different levels of the moderator.  Hopefully you have specific levels of substantive interest, but if not, you could use the mean and/or 1 SD below and above the mean.  I provided a similar example in an earlier post, in which the moderator was labeled W instead of Z:


You can find it by searching "Moderated mediation" in the search bar.  To test whether the indirect effect is moderated by Z, you can either 
  1. run a more-constrained model in which the indirect effects at each level of Z are constrained to be equal (e.g., ' ab0 == ab1 ') and use anova() to compare them, or 
  2. create user-defined parameter(s) that are differences between the indirect effects at different levels of Z (e.g., ' ab01 := ab0 - ab1 '

Terry

Reply all
Reply to author
Forward
0 new messages