Plot observed CFA fit indices against the simulated null distribution
Source:R/cfa_cutoff.R
RMdimCFAPlot.RdFaceted histograms of the simulated CFI, RMSEA, and SRMR distributions (one panel per index), with the observed value overlaid as a vertical line. The line is coloured red when the observed value falls outside the chosen percentile of the simulation in the unfavourable direction (CFI from below; RMSEA / SRMR from above), and grey otherwise.
Arguments
- cutoff_res
The list returned by
RMdimCFACutoffwithoutput = "list", or the kable returned withoutput = "kable"(the underlying list is read fromattr(., "result")).- percentile
Numeric in (50, 100) or
NULL. When supplied, the cutoff and the flagged status are recomputed at this percentile from the simulated distribution stored incutoff_res(no re-simulation needed). WhenNULL(default), the percentile that was used by the originalRMdimCFACutoff()call is reused.
Examples
# \donttest{
if (requireNamespace("lavaan", quietly = TRUE) &&
requireNamespace("ggplot2", quietly = TRUE)) {
data("raschdat1", package = "eRm")
res <- RMdimCFACutoff(raschdat1[, 1:8], iterations = 50,
parallel = FALSE, seed = 1, output = "list")
RMdimCFAPlot(res) # use the percentile from RMdimCFACutoff()
RMdimCFAPlot(res, percentile = 95) # override (no re-simulation needed)
}
# }