# Population covariance from a fully fixed model (see cov_sem()).
pop_model <- "
f1 =~ 1*y1 + 0.8*y2 + 0.8*y3
f2 =~ 1*y4 + 0.8*y5 + 0.8*y6
f2 ~ 0.5*f1
f1 ~~ 1*f1
f2 ~~ 0.75*f2
y1 ~~ 0.5*y1; y2 ~~ 0.5*y2; y3 ~~ 0.5*y3
y4 ~~ 0.5*y4; y5 ~~ 0.5*y5; y6 ~~ 0.5*y6
"
Sigma <- cov_sem(pop_model)$sigma_theta
# Free analysis model with the target structural path labeled "b".
analysis_model <- "
f1 =~ y1 + y2 + y3
f2 =~ y4 + y5 + y6
f2 ~ b*f1
"
ss_aipe_sem_path(model = analysis_model, Sigma = Sigma,
desired_width = 0.30, which_path = "b")
# That sample size holds the interval to the desired width on average, so
# about half of the studies it plans return a wider one. Adding assurance
# plans for the width to be met in 90 percent of studies instead, at the
# cost of a larger sample size.
ss_aipe_sem_path(model = analysis_model, Sigma = Sigma,
desired_width = 0.30, which_path = "b",
assurance = 0.90)
Run the code above in your browser using DataLab