semPower.postHoc | R Documentation |
Performs a post-hoc power analysis, i. e., determines power (= 1 - beta) given alpha, df, and and a measure of effect.
semPower.postHoc(
effect = NULL,
effect.measure = NULL,
alpha,
N,
df = NULL,
p = NULL,
SigmaHat = NULL,
Sigma = NULL,
muHat = NULL,
mu = NULL,
fittingFunction = "ML",
simulatedPower = FALSE,
modelH0 = NULL,
modelH1 = NULL,
simOptions = NULL,
lavOptions = NULL,
lavOptionsH1 = lavOptions,
...
)
effect |
effect size specifying the discrepancy between the null hypothesis (H0) and the alternative hypothesis (H1). A list for multiple group models; a vector of length 2 for effect-size differences. Can be |
effect.measure |
type of effect, one of |
alpha |
alpha error |
N |
the number of observations (a list for multiple group models) |
df |
the model degrees of freedom. See |
p |
the number of observed variables, only required for |
SigmaHat |
can be used instead of |
Sigma |
can be used instead of |
muHat |
can be used instead of |
mu |
can be used instead of |
fittingFunction |
one of |
simulatedPower |
whether to perform a simulated ( |
modelH0 |
for simulated power: |
modelH1 |
for simulated power: |
simOptions |
a list of additional options specifying simulation details, see |
lavOptions |
a list of additional options passed to |
lavOptionsH1 |
alternative options passed to |
... |
other parameters related to plots, notably |
Returns a list. Use summary()
to obtain formatted results.
semPower.aPriori()
semPower.compromise()
## Not run:
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.