I am using multilevel SEM to investigate the influence of intelligence on the occurrence of team conflict and to examine the impact of conflict on team performance in multicultural teams. intelligence has been measured at the individual level and conflict and performance have been measured at the team level. Intelligence and conflict are latent variables in which each is measured by three observed variables (x1, x2, x3 for measuring intelligence and y1, y2, y3 for measuring conflict). I am analyzing the data by R and lavaan package. Here is my code:
model<-'
level: 1
intelligence=~x1+x2+x3
Level: 2
conflict=~y1+y2+y3
conflict~intelligence
performance~conflict'
fitmodel <- cfa(model, data=mydata, std.lv=FALSE, cluster="team_id")
However, I get this error when I run my code:
Error in lav_data_full(data = data, group = group, cluster = cluster, : lavaan ERROR: missing observed variables in dataset: intelligence
I would appreciate if you can help me to resolve this error.