| SimResult-class {simsem} | R Documentation |
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.
Objects from the Class
Objects can be created by sim.
Slots
modelType:Analysis model type (CFA, Path, or SEM)
nRep:Number of replications have been created and run simulated data.
coef:Parameter estimates from each replication
se:Standard errors of parameter estimates from each replication
fit:Fit Indices values from each replication
converged:The convergence status of each replication: 0 = convergent, 1 = not convergent, 2 = nonconvergent in multiple imputed results, 3 = improper solutions for SE (less than 0 or NA), 4 = converged with improper solution for latent or observed (residual) covariance matrix (i.e., nonpositive definite, possible due to a Heywood case). For multiple imputations, these codes are applied when the proporion of imputed data sets with that characteristic is below the
convergentCutoffthreshold (seelinkS4class{SimMissing}). ForOpenMxanalyses only, a code "7" indicates Optimal estimates could not be obtained ("Status 6" inOpenMx).seed:integerused to set the seed for the L'Ecuyer-CMRG pseudorandom number generator.paramValue:Population model underlying each simulated dataset.
stdParamValue:Standardized parameters of the population model underlying each simulated dataset.
paramOnly:If
TRUE, the result object saves only population characteristics and do not save sample characteristics (e.g., parameter estimates and standard errors.misspecValue:Misspecified-parameter values that are imposed on the population model in each replication.
popFit:The amount of population misfit. See details at
summaryMisspecFMI1:Fraction Missing Method 1.
FMI2:Fraction Missing Method 2.
cilower:Lower bounds of confidence interval.
ciupper:Upper bounds of confidence interval.
stdCoef:Standardized coefficients from each replication
stdSe:Standard Errors of Standardized coefficients from each replication
n:The total sample size of the analyzed data.
nobs:The sample size within each group.
pmMCAR:Percent missing completely at random.
pmMAR:Percent missing at random.
extraOut:Extra outputs obtained from running the function specified in
outfunargument in thesimfunction.timing:Time elapsed in each phase of the simulation.
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. -
coefto extract parameter estimates of each replication -
findCoverageto find a value of independent variables (e.g., sample size) that provides a given value of coverage rate. -
findPowerto find a value of independent variables (e.g., sample size) that provides a given value of power of a parameter estimate. -
getCoverageto get the coverage rate of the confidence interval of each parameter estimate -
getCIwidthto get a median or percentile rank (assurance) of confidence interval widths of parameters estimates -
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. -
inspectExtract target information from the simulation result. The available information is listed in thislink -
likRatioFitto find the likelihood ratio (or Bayes factor) based on the bivariate distribution of fit indices -
plotCoverageto plot the coverage rate of confidence interval of parameter estimates -
plotCIwidthto plot confidence interval widths with a line of a median or percentile rank (assurance) -
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. -
summarySeedto provide a summary of the seed number in the simulation -
summaryShortto provide a short summary of the result output -
summaryTimeto provide a summary of time elapsed in the simulation
Author(s)
Sunthud Pornprasertmanit (psunthud@gmail.com)
See Also
-
simfor the constructor of this class
Examples
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)