sim problem with indDist argument!

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

sim problem with indDist argument!

Leade7
Hello,

Please help! I have a problem to re-run the example from "simsem package" when I use the "sim" function and adding the "indDist" argument. Here is the following code and error message I received :

# Example of using simsem model template

popModel <- "
f1 =~ 0.7*y1 + 0.7*y2 + 0.7*y3
f2 =~ 0.7*y4 + 0.7*y5 + 0.7*y6
f1 ~~ 1*f1
f2 ~~ 1*f2
f1 ~~ 0.5*f2
y1 ~~ 0.49*y1
y2 ~~ 0.49*y2
y3 ~~ 0.49*y3
y4 ~~ 0.49*y4
y5 ~~ 0.49*y5
y6 ~~ 0.49*y6
"

analysisModel <- "
f1 =~ y1 + y2 + y3
f2 =~ y4 + y5 + y6
f1 ~~ 1*f1
f2 ~~ 1*f2
f1 ~~ f2
y1 ~~ y1
y2 ~~ y2
y3 ~~ y3
y4 ~~ y4
y5 ~~ y5
y6 ~~ y6
"

dist2 <- bindDist(skewness = seq(-3, 3, length.out=6), kurtosis = seq(2, 5, length.out=6))
summary(dist2)

Output <- sim(5, model=analysisModel, n=150, generate=popModel, std.lv=TRUE, lavaanfun = "cfa", indDist = dist2)
summary(Output)

Erreur : $ operator not defined for this S4 class

Thank you in advance
Leade