Description Usage Arguments Value Author(s) See Also Examples
This function will plot sampling distributions of fit indices that visualize power in rejecting the misspecified models
1 2 3 
altObject 
The result object ( 
nullObject 
The result object ( 
cutoff 
A vector of priori cutoffs for fit indices. 
usedFit 
Vector of names of fit indices that researchers wish to plot. 
alpha 
A priori alpha level 
contN 
Include the varying sample size in the power plot if available 
contMCAR 
Include the varying MCAR (missing completely at random percentage) in the power plot if available 
contMAR 
Include the varying MAR (missing at random percentage) in the power plot if available 
useContour 
If there are two of sample size, percent completely at random, and percent missing at random are varying, the 
logistic 
If 
NONE. Only plot the fit indices distributions.
Sunthud Pornprasertmanit (psunthud@gmail.com)
SimResult
for simResult that used in this function.
getCutoff
to find values of cutoffs based on null hypothesis sampling distributions only
getPowerFit
to find power of rejecting the hypothesized model when the hypothesized model is FALSE
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48  ## Not run:
# Null model: One factor model
loading.null < matrix(0, 6, 1)
loading.null[1:6, 1] < NA
LY.NULL < bind(loading.null, 0.7)
RPS.NULL < binds(diag(1))
RTE < binds(diag(6))
CFA.Model.NULL < model(LY = LY.NULL, RPS = RPS.NULL, RTE = RTE, modelType="CFA")
# We make the examples running only 5 replications to save time.
# In reality, more replications are needed.
Output.NULL < sim(50, n=50, model=CFA.Model.NULL, generate=CFA.Model.NULL)
# Alternative model: Twofactor model
loading.alt < matrix(0, 6, 2)
loading.alt[1:3, 1] < NA
loading.alt[4:6, 2] < NA
LY.ALT < bind(loading.alt, 0.7)
latent.cor.alt < matrix(NA, 2, 2)
diag(latent.cor.alt) < 1
RPS.ALT < binds(latent.cor.alt, 0.5)
CFA.Model.ALT < model(LY = LY.ALT, RPS = RPS.ALT, RTE = RTE, modelType="CFA")
Output.ALT < sim(50, n=50, model=CFA.Model.NULL, generate=CFA.Model.ALT)
# Plot the power based on derived cutoff from the null model using four fit indices
plotPowerFit(Output.ALT, nullObject=Output.NULL, alpha=0.05,
usedFit=c("RMSEA", "CFI", "TLI", "SRMR"))
# Plot the power of rejecting null model when the rule of thumb from Hu & Bentler (1999) is used
Rule.of.thumb < c(RMSEA=0.05, CFI=0.95, TLI=0.95, SRMR=0.06)
plotPowerFit(Output.ALT, cutoff=Rule.of.thumb, alpha=0.05,
usedFit=c("RMSEA", "CFI", "TLI", "SRMR"))
# The example of continous varying sample size. Note that more finegrained
# values of n is needed, e.g., n=seq(50, 500, 1)
Output.NULL2 < sim(NULL, n=seq(50, 250, 25), model=CFA.Model.NULL, generate=CFA.Model.NULL)
Output.ALT2 < sim(NULL, n=seq(50, 250, 25), model=CFA.Model.NULL, generate=CFA.Model.ALT)
# Plot the power based on derived cutoff from the null model using four fit indices
# along sample size
plotPowerFit(Output.ALT2, nullObject=Output.NULL2, alpha=0.05,
usedFit=c("RMSEA", "CFI", "TLI", "SRMR"))
# Plot the power based on rule of thumb along sample size
plotPowerFit(Output.ALT2, cutoff=Rule.of.thumb, alpha=0.05,
usedFit=c("RMSEA", "CFI", "TLI", "SRMR"))
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.