if (FALSE) {
# determine the required sample size to reject a model showing misspecifications
# amounting to RMSEA >= .05 on 200 df with a power of 95 % on alpha = .05
ap <- semPower.aPriori(effect = .05, effect.measure = "RMSEA",
alpha = .05, beta = .05, df = 200)
summary(ap)
# use f0 as effect size metric
ap <- semPower.aPriori(effect = .15, effect.measure = "F0",
alpha = .05, power = .80, df = 200)
summary(ap)
# 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.
ap <- semPower.aPriori(effect = c(.05, .06), effect.measure = "RMSEA",
alpha = .05, power = .80, df = c(200, 210))
summary(ap)
# power analysis based on SigmaHat and Sigma (nonsense example)
ap <- semPower.aPriori(alpha = .05, beta = .05, df = 5,
SigmaHat = diag(4), Sigma = cov(matrix(rnorm(4*1000), ncol=4)))
summary(ap)
# multiple group example
ap <- semPower.aPriori(effect = list(.05, .10), effect.measure = "F0",
alpha = .05, power = .80, df = 100,
N = list(1, 1))
summary(ap)
# simulated power analysis (nonsense example)
ap <- semPower.aPriori(alpha = .05, beta = .05, 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(ap)
}
Run the code above in your browser using DataLab