Learn R Programming

simsem (version 0.2-8)

SimResult-class: Class "SimResult"

Description

This class will save data analysis results from multiple replications and ready to find some useful statistics, such as fit indices cutoffs or power.

Arguments

Objects from the Class

Objects can be created by simResult. It can also be called from the form new("SimResult", ...).

Methods

  • getCutoffto getCutoff of fit indices based on a priori alpha level.
  • getPowerFitto getPowerFit of rejection when the simResult is the alternative hypothesis and users specify cutoffs of the fit indices.
  • plotCutoffto plot null hypothesis sampling distributions of fit indices with an option to draw fit indices cutoffs by specifying a priori alpha level.
  • plotPowerFitto plot alternative hypothesis (and null hypothesis) with a priori cutoffs or alpha level.
  • summaryto summarize the result output
  • summaryParamto summarize all parameter estimates
  • anovafind 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. Seeanovafor further details.
  • summaryPopulationto summarize the data generation population underlying the simulation study.
  • getPopulationto extract the data generation population underlying the simulation study. This method will return a data frame of the population underlying each replication.
  • setPopulationto put the appropriate data generation model into the result object. If the appropriate data generation model is put (the same model as the analysis model), the bias in parameter estimates and standard errors will be able to be calculated by thesummaryfunction. The first argument is the result object. The second argument can be eitherdata.frameof the population orSimSetof the population. See the 'modeling with covariate' in the manual for an example.

See Also

  • SimDatafor data generation model.
  • SimModelfor analysis model
  • simResultfor the constructor of this class

Examples

Run this code
showClass("SimResult")
loading <- matrix(0, 6, 1)
loading[1:6, 1] <- NA
LX <- simMatrix(loading, 0.7)
RPH <- symMatrix(diag(1))
RTD <- symMatrix(diag(6))
CFA.Model <- simSetCFA(LY = LX, RPS = RPH, RTE = RTD)
SimData <- simData(CFA.Model, 500)
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)
summary(Output)
getCutoff(Output, 0.05)
summaryParam(Output)
summaryPopulation(Output)
param <- getPopulation(Output)
Output <- setPopulation(Output, param)
Output2 <- setPopulation(Output, CFA.Model)

Run the code above in your browser using DataLab