I am trying to conduct a measurement invariance test on a multilevel CFA model, where I am interested in the Within Person structure of affect, using repeated measures.
I want to compare the within-person measurement model across two groups and therefore saturated the between-person level.
twolevel <- '
group: 1
level: 1
f1 =~ 1*relaxed + a*happy + b*euphoric
f2 =~ 1*depressed + d*stressed + e*anxious + f*anger
level: 2
relaxed ~~ relaxed + happy + euphoric + depressed + stressed + anxious + anger
happy ~~ happy + euphoric + depressed + stressed + anxious + anger
euphoric ~~ euphoric + depressed + stressed + anxious + anger
depressed ~~ depressed + stressed + anxious + anger
stressed ~~ stressed + anxious + anger
anxious ~~ anxious + anger
anger ~~ anger
group: 2
level: 1
f1 =~ 1*relaxed + a*happy + b*euphoric
f2 =~ 1*depressed + d*stressed + e*anxious + f*anger
level: 2
relaxed ~~ relaxed + happy + euphoric + depressed + stressed + anxious + anger
happy ~~ happy + euphoric + depressed + stressed + anxious + anger
euphoric ~~ euphoric + depressed + stressed + anxious + anger
depressed ~~ depressed + stressed + anxious + anger
stressed ~~ stressed + anxious + anger
anxious ~~ anxious + anger
anger ~~ anger
'
results <- cfa(twolevel, data = data, group = "HC", cluster = 'PID', optim.method = "em", group.equal = "loadings")
I am now trying to check for measurement invariance of the loadings on the within person factors and tried the group.equal setting which normally works in a multigroup model, but does not work here...