if (FALSE) {
# achieved power with a sample of N = 250 to detect misspecifications corresponding
# to RMSEA >= .05 on 200 df on alpha = .05.
ph <- semPower.postHoc(effect = .05, effect.measure = "RMSEA",
alpha = .05, N = 250, df = 200)
summary(ph)
# power analysis for to detect the difference between a model (with df = 200) exhibiting RMSEA = .05
# and a model (with df = 210) exhibiting RMSEA = .06.
ph <- semPower.postHoc(effect = c(.05, .06), effect.measure = "RMSEA",
alpha = .05, N = 500, df = c(200, 210))
summary(ph)
# multigroup example
ph <- semPower.postHoc(effect = list(.02, .01), effect.measure = "F0",
alpha = .05, N = list(250, 350), df = 200)
summary(ph)
# power analysis based on SigmaHat and Sigma (nonsense example)
ph <- semPower.postHoc(alpha = .05, N = 1000, df = 5,
SigmaHat = diag(4),
Sigma = cov(matrix(rnorm(4*1000), ncol=4)))
summary(ph)
# simulated power analysis (nonsense example)
ph <- semPower.aPriori(alpha = .05, N = 500, df = 200,
SigmaHat = list(diag(4), diag(4)),
Sigma = list(cov(matrix(rnorm(4*1000), ncol=4)),
cov(matrix(rnorm(4*1000), ncol=4))),
simulatedPower = TRUE, nReplications = 100)
summary(ph)
}
Run the code above in your browser using DataLab