Learn R Programming

simsem (version 0.4-6)

SimResult-class: Class "SimResult": Simulation Result Object

Description

This class will save data analysis results from multiple replications, such as fit indices cutoffs or power, parameter values, model misspecification, etc.

Arguments

Objects from the Class

Objects can be created by sim.

Methods

The following methods are listed alphabetically. More details can be found by following the link of each method.
  • anovato find the averages of model fit statistics and indices for nested models, as well as the differences of model fit indices among models. This function requires at least twoSimResultobjects.
  • findPowerto find a value of independent variables (e.g., sample size) that provides a given value of power of a parameter estimate.
  • getCutoffto get the cutoff of fit indices based on a priori alpha level.
  • getCutoffNestedto get the cutoff of the difference in fit indices of nested models based on a priori alpha level.
  • getCutoffNonNestedto get the cutoff of the difference in fit indices of nonnested models based on a priori alpha level.
  • getExtraOutputto get extra outputs that users requested before running a simulation
  • getPopulationto get population parameter values underlying each dataset
  • getPowerto get the power of each parameter estimate
  • getPowerFitto get the power in rejecting alternative models based on absolute model fit cutoff.
  • getPowerFitNestedto get the power in rejecting alternative models based on the difference between model fit cutoffs of nested models.
  • getPowerFitNonNestedto get the power in rejecting alternative models based on the difference between model fit cutoffs of nonnested models.
  • likRatioFitto find the likelihood ratio (or Bayes factor) based on the bivariate distribution of fit indices
  • plotCutoffto plot sampling distributions of fit indices with an option to draw fit indices cutoffs by specifying a priori alpha level.
  • plotCutoffNestedto plot sampling distributions of the difference in fit indices between nested models with an option to draw fit indices cutoffs by specifying a priori alpha level.
  • plotCutoffNonNestedto plot sampling distributions of the difference in fit indices between nonnested models with an option to draw fit indices cutoffs by specifying a priori alpha level.
  • plotMisfitto visualize the population misfit and misspecified parameter values
  • plotPowerto plot power of parameter estimates
  • plotPowerFitto plot the power in rejecting alternative models based on absolute model fit cutoff.
  • plotPowerFitNestedto plot the power in rejecting alternative models based on the difference between model fit cutoffs of nested models.
  • plotPowerFitNonNestedto plot the power in rejecting alternative models based on the difference between model fit cutoffs of nonnested models.
  • pValueto find a p-value in comparing sample fit indices with the null sampling distribution of fit indices
  • pValueNestedto find a p-value in comparing the difference in sample fit indices between nested models with the null sampling distribution of the difference in fit indices
  • pValueNonNestedto find a p-value in comparing the difference in sample fit indices between nonnested models with the null sampling distribution of the difference in fit indices
  • setPopulationto set population model for computing bias
  • summaryto summarize the result output
  • summaryConvergeto provide a head-to-head comparison between the characteristics of convergent and nonconvergent replications
  • summaryMisspecto provide a summary of model misfit
  • summaryParamto summarize all parameter estimates
  • summaryPopulationto summarize the data generation population underlying the simulation study.
  • summaryShortto provide a short summary of the result output

See Also

  • simfor the constructor of this class

Examples

Run this code
showClass("SimResult")
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)

# Summary the simulation result
summary(Output)

# Short summary of the simulation result
summaryShort(Output)

# Find the fit index cutoff
getCutoff(Output, 0.05)

# Summary of parameter estimates
summaryParam(Output)

# Summary of population parameters
summaryPopulation(Output)

Run the code above in your browser using DataLab