Learn R Programming

simsem (version 0.5-16)

summaryFit: Provide summary of model fit across replications

Description

This function will provide fit index cutoffs for values of alpha, and mean fit index values across all replications.

Usage

summaryFit(object, alpha = NULL, improper = TRUE, usedFit = NULL)

Arguments

object

'>SimResult to be summarized

alpha

The alpha level used to find the fit indices cutoff. If there is no varying condition, a vector of different alpha levels can be provided.

improper

If TRUE, include the replications that provided improper solutions

usedFit

Vector of names of fit indices that researchers wish to summarize.

Value

A data frame that provides fit statistics cutoffs and means

When linkS4class{SimResult} has fixed simulation parameters the first colmns are fit index cutoffs for values of alpha and the last column is the mean fit across all replications. Rows are

  • Chi Chi-square fit statistic

  • AIC Akaike Information Criterion

  • BIC Baysian Information Criterion

  • RMSEA Root Mean Square Error of Approximation

  • CFI Comparative Fit Index

  • TLI Tucker-Lewis Index

  • SRMR Standardized Root Mean Residual

When linkS4class{SimResult} has random simulation parameters (sample size or percent missing), columns are the fit indices listed above and rows are values of the random parameter.

See Also

'>SimResult for the result object input

Examples

Run this code
# NOT RUN {
loading <- matrix(0, 6, 1)
loading[1:6, 1] <- NA
LY <- bind(loading, 0.7)
RPS <- binds(diag(1))
RTE <- binds(diag(6))
CFA.Model <- model(LY = LY, RPS = RPS, RTE = RTE, modelType="CFA")

# We make the examples running only 5 replications to save time.
# In reality, more replications are needed.
Output <- sim(5, n=500, CFA.Model)

# Summarize the sample fit indices
summaryFit(Output)
# }

Run the code above in your browser using DataLab