library(bmem)
ex3model<-"
y ~ start(c(.283, .283))*x + c(c1,c2)*x + start(c(.36, .14))*m +c(b1,b2)*m
m ~ start(c(.721, .721))*x + c(a1,a2)*x
m =~ c(1,1)*m1 + start(c(.8,.8))*m2 + start(c(.8,.8))*m3
x ~~ start(c(.25, .25))*x
y ~~ start(c(.81, .95))*y
m ~~ start(c(.87, .87))*m
m1 ~~ start(c(.36, .36))*m1
m2 ~~ start(c(.36, .36))*m2
m3 ~~ start(c(.36, .36))*m3
"
indirect<-'
med1 := a1*b1
med2 := a2*b2
diffmed := a1*b1 - a2*b2
'
bootstrap<-power.boot(ex3model, indirect, nobs=c(400,200), nrep=2000, nboot=1000, parallel='multicore')
summary(bootstrap)