我正在使用蒙特卡罗模拟来运行纵向中介模型的功耗分析。我使用的是bmem包(lavaan)中的power.boot函数。
我只用5个reps/5个bootstrap检查了代码,以确保它能正常工作。
然后,我按照包文档的建议,用1000个rep,1000个bootstrap运行代码。
现在已经超过一个小时了,它还在运行--这正常吗?多长时间才算太长?
代码语言:javascript复制powermodel1 <-'
x2 ~ start(.6)*x1 + x*x1
x3 ~ start(.6)*x2 + x*x2
m2 ~ start(.15)*x1 + a*x1 + start(.3)*m1 + m*m1
m3 ~ start(.15)*x2 + a*x2 + start(.3)*m2 + m*m2
y2 ~ start(.5)*m1 + b*m2 + start(.3)*y1 + y*y1
y3 ~ start(.5)*m2 + b*m2 + start(.3)*y2 + y*y2 + start(0.05)*x1 + c*x1
x1 ~~ start(.15)*m1
x1 ~~ start(.15)*y1
y1 ~~ start(.5)*m1
'
indirect <- 'ab:=a*b'
N<-200
system.time(bootstrap<-power.boot(powermodel1, indirect, N, nrep=1000, nboot=1000, parallel = 'multicore'))
summary(bootstrap)