# NOT RUN {
#To specify the model
ex2model ="
ept ~ start(0.4)*hvltt + b*hvltt + start(0)*age + start(0)*edu + start(2)*R
hvltt ~ start(-0.35)*age + a*age +c*edu + start(0.5)*edu
R ~ start(-0.06)*age + start(0.2)*edu
R =~ 1*ws + start(0.8)*ls + start(0.5)*lt
age ~~ start(30)*age
edu ~~ start(8)*edu
age ~~ start(-2.8)*edu
hvltt ~~ start(23)*hvltt
R ~~ start(14)*R
ws ~~ start(3)*ws
ls ~~ start(3)*ls
lt ~~ start(3)*lt
ept ~~ start(3)*ept
"
#To specify the indirect effects
indirect = "ind1 := a*b + c*b"
nobs <- seq(100, 2000, by =200)
#To calculate power curve:
power.curve = wp.mc.sem.power.curve(model=ex2model, indirect=indirect,
nobs=nobs, type='boot', parallel="muticore")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab