Learn R Programming

simsem (version 0.2-8)

plotCutoff: Plot sampling distributions of fit indices with fit indices cutoffs

Description

This function will plot sampling distributions of null hypothesis fit indices. The users may add cutoffs by specifying the alpha level.

Usage

plotCutoff(object, ...)

Arguments

object
The object (SimResult or data.frame) that contains values of fit indices in each distribution.
...
Other arguments specific to different types of object you pass in the function.

Value

  • NONE. Only plot the fit indices distributions.

Details in ...

  • cutoff: A priori cutoffs for fit indices, saved in a vector
  • cutoff2: Another set of priori cutoffs for fit indices, saved in a vector
  • alpha: A priori alpha level to getCutoffs of fit indices (do not specify when you havecutoff)
  • revDirec: The default is to find critical point on the side that indicates worse fit (the right side of RMSEA or the left side of CFI). If specifying as TRUE, the directions are reversed.
  • usedFit: The name of fit indices that researchers wish to plot
  • useContour: If there are two of sample size, percent completely at random, and percent missing at random are varying, theplotCutofffunction will provide 3D graph. Contour graph is a default. However, if this is specified asFALSE, perspective plot is used.

See Also

  • SimResultfor simResult that used in this function.
  • getCutoffto find values of cutoffs based on null hypothesis sampling distributions only

Examples

Run this code
loading <- matrix(0, 6, 2)
loading[1:3, 1] <- NA
loading[4:6, 2] <- NA
loadingValues <- matrix(0, 6, 2)
loadingValues[1:3, 1] <- 0.7
loadingValues[4:6, 2] <- 0.7
LX <- simMatrix(loading, loadingValues)
latent.cor <- matrix(NA, 2, 2)
diag(latent.cor) <- 1
RPH <- symMatrix(latent.cor, 0.5)
error.cor <- matrix(0, 6, 6)
diag(error.cor) <- 1
RTD <- symMatrix(error.cor)
CFA.Model <- simSetCFA(LY = LX, RPS = RPH, RTE = RTD)
SimData <- simData(CFA.Model, 200)
SimModel <- simModel(CFA.Model)
# We make the examples running only 5 replications to save time.
# In reality, more replications are needed.
Output <- simResult(5, SimData, SimModel)
plotCutoff(Output, 0.05, usedFit=c("RMSEA", "SRMR", "CFI", "TLI"))

# Varying N
Output2 <- simResult(NULL, SimData, SimModel, n=seq(450, 500, 10))
plotCutoff(Output2, 0.05)

# Varying N and pmMCAR
Output3 <- simResult(NULL, SimData, SimModel, n=seq(450, 500, 10), pmMCAR=c(0, 0.05, 0.1, 0.15))
plotCutoff(Output3, 0.05)

Run the code above in your browser using DataLab