sim: Run a Monte Carlo simulation with a structural equation...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sim.R

Description

This function can be used to generate data, analyze the generated data, and summarized into a result object where parameter estimates, standard errors, fit indices, and other characteristics of each replications are saved.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sim(nRep, model, n, generate = NULL, ..., rawData = NULL, miss = NULL, datafun=NULL,
	lavaanfun = "lavaan", outfun=NULL, outfundata = NULL, pmMCAR = NULL,
	pmMAR = NULL, 	facDist = NULL, indDist = NULL, errorDist = NULL,
	sequential = FALSE, saveLatentVar = FALSE, modelBoot = FALSE, realData = NULL,
	covData = NULL, maxDraw = 50, misfitType = "f0", misfitBounds = NULL,
	averageNumMisspec = FALSE, optMisfit=NULL, optDraws = 50,
	createOrder = c(1, 2, 3), aux = NULL, group = NULL, mxFit = FALSE,
	mxMixture = FALSE, citype = NULL, cilevel = 0.95, seed = 123321, silent = FALSE,
	multicore = options('simsem.multicore')[[1]], cluster = FALSE,
	numProc = NULL, paramOnly = FALSE, dataOnly=FALSE, smartStart=FALSE,
	previousSim = NULL, completeRep = FALSE, stopOnError = FALSE)

Arguments

nRep

Number of replications. If any of the n, pmMCAR, or pmMAR arguments are specified as lists, the number of replications will default to the length of the list(s), and nRep need not be specified (can be set NULL).

model

There are three options for this argument: 1. SimSem object created by model, 2. lavaan script, lavaan parameter table, fitted lavaan object matching the analysis model, or a list that contains all argument that users use to run lavaan (including cfa, sem, lavaan), 3. MxModel object from the OpenMx package, or 4. a function that takes a data set and return a list of coef, se, and converged (see details below). For the SimSem object, if the generate argument is not specified, then the object in the model argument will be used for both data generation and analysis. If generate is specified, then the model argument will be used for data analysis only.

n

Sample size(s). In single-group models, either a single integer, or a vector of integers to vary sample size across replications. In multigroup models, either a list of single integers (for constant group sizes across replications) or a list of vectors (to vary group sizes across replications). Any non-integers will be rounded.

generate

There are four options for this argument: 1. SimSem object created by model, 2. lavaan script, lavaan parameter table (for data generation; see simulateData), fitted lavaan object that estimated all nonzero population parameters, or a list that contains all argument that users use to run simulateData, 3. MxModel object with population parameters specified in the starting values of all matrices in the model, 4. a function that take only one sample size argument (by integer for single-group model or by a vector of integers for multiple-group model). The generate argument cannot be specified the same time as the rawData argument.

rawData

There are two options for this argument: 1. a list of data frames to be used in simulations or 2. a population data. If a list of data frames is specified, the nRep and n arguments must not be specified. If a population data frame is specified, the nRep and n arguments are required.

miss

A missing data template created using the miss function.

datafun

A function to be applied to each generated data set across replications.

lavaanfun

The character of the function name used in running lavaan model ("cfa", "sem", "growth", "lavaan"). This argument is required only when lavaan script or a list of arguments is specified in the model argument.

outfun

A function to be applied to the lavaan output at each replication. Output from this function in each replication will be saved in the simulation output (SimResult), and can be obtained using the getExtraOutput function.

outfundata

A function to be applied to the lavaan output and the generated data at each replication. Users can get the characteristics of the generated data and also compare the characteristics with the generated output. The output from this function in each replication will be saved in the simulation output (SimResult), and can be obtained using the getExtraOutput function.

pmMCAR

The percentage of data completely missing at random (0 <= pmMCAR < 1). Either a single value or a vector of values in order to vary pmMCAR across replications (with length equal to nRep or a divisor of nRep). The objMissing argument is only required when specifying complex missing value data generation, or when using multiple imputation.

pmMAR

The percentage of data missing at random (0 <= pmCAR < 1). Either a single value or a vector of values in order to vary pmCAR across replications (with length equal to nRep or a divisor of nRep). The objMissing argument is only required when specifying complex missing value data generation, or when using multiple imputation.

facDist

Factor distributions. Either a list of SimDataDist objects or a single SimDataDist object to give all factors the same distribution. Use when sequential is TRUE.

indDist

Indicator distributions. Either a list of SimDataDist objects or a single SimDataDist object to give all indicators the same distribution. Use when sequential is FALSE.

errorDist

An object or list of objects of type SimDataDist indicating the distribution of errors. If a single SimDataDist is specified, each error will be genrated with that distribution.

sequential

If TRUE, a sequential method is used to generate data in which factor data is generated first, and is subsequently applied to a set of equations to obtain the indicator data. If FALSE, data is generated directly from model-implied mean and covariance of the indicators.

saveLatentVar

If TRUE, the generated latent variable scores and measurement error scores are also provided as the attribute of the generated data. Users can use the outfundata to compare the latent variable scores with the estimated output. The sequential argument must be TRUE in order to use this option.

modelBoot

When specified, a model-based bootstrap is used for data generation (for use with the realData argument). See draw for further information.

realData

A data.frame containing real data. Generated data will follow the distribution of this data set.

covData

A data.frame containing covariate data, which can have any distributions. This argument is required when users specify GA or KA matrices in the model template (SimSem).

maxDraw

The maximum number of attempts to draw a valid set of parameters (no negative error variance, standardized coefficients over 1).

misfitType

Character vector indicating the fit measure used to assess the misfit of a set of parameters. Can be "f0", "rmsea", "srmr", or "all".

misfitBounds

Vector that contains upper and lower bounds of the misfit measure. Sets of parameters drawn that are not within these bounds are rejected.

averageNumMisspec

If TRUE, the provided fit will be divided by the number of misspecified parameters.

optMisfit

Character vector of either "min" or "max" indicating either maximum or minimum optimized misfit. If not null, the set of parameters out of the number of draws in "optDraws" that has either the maximum or minimum misfit of the given misfit type will be returned.

optDraws

Number of parameter sets to draw if optMisfit is not null. The set of parameters with the maximum or minimum misfit will be returned.

createOrder

The order of 1) applying equality/inequality constraints, 2) applying misspecification, and 3) fill unspecified parameters (e.g., residual variances when total variances are specified). The specification of this argument is a vector of different orders of 1 (constraint), 2 (misspecification), and 3 (filling parameters). For example, c(1, 2, 3) is to apply constraints first, then add the misspecification, and finally fill all parameters. See the example of how to use it in the draw function.

aux

The names of auxiliary variables saved in a vector.

group

The name of the group variable. This argument is used when lavaan script or MxModel is used in the model only. When generating data from a multigroup population model, the grouping variable in each generated data set will be named "group", so when additionally using a multigroup analysis model, users must specify this argument as group="group".

mxFit

A logical whether to find an extensive list of fit measures (which will be slower). This argument is applicable when MxModel is used in the model argument only.

mxMixture

A logical whether to the analysis model is a mixture model. This argument is applicable when MxModel is used in the model argument only.

citype

Type of confidence interval. For the current version, this argument will be forwarded to the "boot.ci.type" argument in the parameterEstimates function from the lavaan package. This argument is not active when the OpenMx package is used.

cilevel

Confidence level. For the current version, this argument will be forwarded to the "level" argument in the parameterEstimates function from the lavaan package. This argument is not active when the OpenMx package is used.

seed

Random number seed. Note that the seed number is always fixed in the simsem so that users can always replicate the same simulatin or can be confidence that the same data set are generated. Reproducibility across multiple cores or clusters is ensured using R'Lecuyer package.

silent

If TRUE, suppress warnings.

multicore

Users may put TRUE or FALSE. If TRUE, multiple processors within a computer will be utilized. The default value is FALSE. Users may permanently change the default value by assigning the following line: options('simsem.multicore' = TRUE)

cluster

Not applicable now. Used to specify nodes in hpc in order to be parallelizable.

numProc

Number of processors for using multiple processors. If it is NULL, the package will find the maximum number of processors.

paramOnly

If TRUE, only the parameters from each replication will be returned.

dataOnly

If TRUE, only the raw data generated from each replication will be returned.

smartStart

Defaults to FALSE. If TRUE, population parameter values that are real numbers will be used as starting values. When tested in small models, the time elapsed when using population values as starting values was greater than the time reduced during analysis, and convergence rates were not affected.

previousSim

A result object that users wish to add the results of the current simulation in

completeRep

If TRUE, the function will run until the number of convergent replication equal to the specified nRep.

stopOnError

If TRUE, stop running the simulation when the error occurs during the data analysis on any replications.

...

Additional arguments to be passed to lavaan. See also lavOptions

Details

This function is executed as follows: 1. parameters are drawn from the specified data-generation model (applicable only simsem model template, SimSem, only), 2. the drawn (or the specified) parameters are used to create data, 3. data can be transformed using the datafun argument, 4. specified missingness (if any) is imposed, 5. data are analyzed using the specified analysis model, 6. parameter estimates, standard errors, fit indices, and other characteristics of a replication are extracted, 7. additional outputs (if any) are extracted using the outfun argument, and 8. results across replications are summarized in a result object, SimResult).

There are six ways to provide or generate data in this function:

  1. SimSem can be used as a template to generate data, which can be created by the model function. The SimSem can be specified in the generate argument.

  2. lavaan script, parameter table for the lavaan package, or a list of arguments for the simulateData function. The lavaan script can be specified in the generate argument.

  3. MxModel object from the OpenMx package. The MxModel object can be specified in the generate argument.

  4. A list of raw data for each replication can be provided for the rawData argument. The sim function will analyze each data and summarize the result. Note that the generate, n and nRep could not be specified if the list of raw data is provided.

  5. Population data can be provided for the rawData argument. The sim function will randomly draw sample data sets and analyze data. Note that the n and nRep must be specified if the population data are provided. The generate argument must not be specified.

  6. A function can be used to generate data. The function must take sample size in a numeric format (or a vector of numerics for multiple groups) and return a data frame of the generated data set. Note that parameter values and their standardized values can be provided by using the attributes of the resulting data set. That is, users can assign parameter values and standardized parameter values to attr(data, "param") and attr(data, "stdparam").

Note that all generated or provided data can be transformed based on Bollen-Stine approach by providing a real data in the realData argument if any of the first three methods are used.

There are four ways to analyze the data sets for each replication by setting the model argument as

  1. SimSem can be used as a template for data analysis.

  2. lavaan script, parameter table for the lavaan package, or a list of arguments for the lavaan, sem, cfa, or growth function. Note that if the desired function to analyze data can be specified in the lavaanfun argument, which the default is the lavaan function

  3. MxModel object from the OpenMx package. The object does not need to have data inside. Note that if users need an extensive fit indices, the mxFit argument should be specified as TRUE. If users wish to analyze by mixture model, the mxMixture argument should be TRUE such that the sim function knows how to handle the data.

  4. A function that takes a data set and returns a list. The list must contain at least three objects: a vector of parameter estimates (coef), a vector of standard error (se), and the convergence status as TRUE or FALSE (converged). There are seven optional objects in the list: a vector of fit indices (fit), a vector of standardized estimates (std), a vector of standard errors of standardized estimates (stdse), fraction missing type I (FMI1), fraction missing type II (FMI2), lower bounds of confidence intervals (cilower), and upper bounds of confidence intervals (ciupper). Note that the coef, se, std, stdse, FMI1, FMI2, cilower, and ciupper must be a vector with names. The name of those vectors across different objects must be the same. Users may optionally specify other objects in the list; however, the results of the other objects will not be automatically combined. Users need to specify the outfun argument to get the extra objects. For example, researchers may specify residuals in the list. The outfun argument should have the function as follows: function(obj) obj$residuals.

Any combination of data-generation methods and data-analysis methods are valid. For example, data can be simulated using lavaan script and analyzed by MxModel. Paralleled processing can be enabled using the multicore argument.

Value

A result object (SimResult)

Author(s)

Patrick Miller (University of Notre Dame; pmille13@nd.edu) Sunthud Pornprasertmanit (psunthud@gmail.com)

See Also

Examples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
# Please go to https://simsem.org/ for more examples in the Vignettes.

## Example of using simsem model template
library(lavaan)

loading <- matrix(0, 6, 2)
loading[1:3, 1] <- NA
loading[4:6, 2] <- NA
LY <- bind(loading, 0.7)

latent.cor <- matrix(NA, 2, 2)
diag(latent.cor) <- 1
RPS <- binds(latent.cor, 0.5)

RTE <- binds(diag(6))

VY <- bind(rep(NA,6),2)

CFA.Model <- model(LY = LY, RPS = RPS, RTE = RTE, modelType = "CFA")

# In reality, more than 5 replications are needed.
Output <- sim(5, CFA.Model, n=200)
summary(Output)



## Example of using lavaan model syntax

popModel <- "
f1 =~ 0.7*y1 + 0.7*y2 + 0.7*y3
f2 =~ 0.7*y4 + 0.7*y5 + 0.7*y6
f1 ~~ 1*f1
f2 ~~ 1*f2
f1 ~~ 0.5*f2
y1 ~~ 0.49*y1
y2 ~~ 0.49*y2
y3 ~~ 0.49*y3
y4 ~~ 0.49*y4
y5 ~~ 0.49*y5
y6 ~~ 0.49*y6
"

analysisModel <- "
f1 =~ y1 + y2 + y3
f2 =~ y4 + y5 + y6
"

Output <- sim(5, model=analysisModel, n=200, generate=popModel, std.lv=TRUE, lavaanfun = "cfa")
summary(Output)



## Example of using raw data as the population
pop <- data.frame(y1 = rnorm(100000, 0, 1), y2 = rnorm(100000, 0, 1))
covModel <- " y1 ~~ y2 "
Output <- sim(5, model=covModel, n=200, rawData=pop, lavaanfun = "cfa")
summary(Output)



## Example of user-defined functions:

# data-transformation function: Transforming to standard score
fun1 <- function(data) {
	temp <- scale(data)
	as.data.frame(temp)
}

# additional-output function: Extract modification indices from lavaan
fun2 <- function(out) {
	inspect(out, "mi")
}

# In reality, more than 5 replications are needed.
Output <- sim(5, CFA.Model,n=200,datafun=fun1, outfun=fun2)
summary(Output)

# Get modification indices
getExtraOutput(Output)



## Example of additional output: Comparing latent variable correlation

outfundata <- function(out, data) {
	predictcor <- lavInspect(out, "est")$psi[2, 1]
	latentvar <- attr(data, "latentVar")[,c("f1", "f2")]
	latentcor <- cor(latentvar)[2,1]
	latentcor - predictcor
}
Output <- sim(5, CFA.Model, n=200, sequential = TRUE, saveLatentVar = TRUE,
            	outfundata = outfundata)
getExtraOutput(Output)



## Example of analyze using a function

analyzeFUN <- function(data) {
	out <- lm(y2 ~ y1, data=data)
	coef <- coef(out)
	se <- sqrt(diag(vcov(out)))
	fit <- c(loglik = as.numeric(logLik(out)))
	converged <- TRUE # Assume to be convergent all the time
	return(list(coef = coef, se = se, fit = fit, converged = converged))
}
Output <- sim(5, model=analyzeFUN, n=200, rawData=pop, lavaanfun = "cfa")
summary(Output)

Example output

Loading required package: lavaan
This is lavaan 0.6-7
lavaan is BETA software! Please report any bugs.
 
#################################################################
This is simsem 0.5-15
simsem is BETA software! Please report any bugs.
simsem was first developed at the University of Kansas Center for
Research Methods and Data Analysis, under NSF Grant 1053160.
#################################################################

Attaching package:simsemThe following object is masked frompackage:lavaan:

    inspect

Progress: 1 / 5 
Progress: 2 / 5 
Progress: 3 / 5 
Progress: 4 / 5 
Progress: 5 / 5 
RESULT OBJECT
Model Type
[1] "cfa"
========= Fit Indices Cutoffs ============
           Alpha
Fit Indices      0.1     0.05     0.01    0.001     Mean     SD
      chisq   16.166   17.613   18.770   19.031    8.543  6.920
      aic   3145.232 3152.617 3158.525 3159.855 3113.358 36.958
      bic   3207.900 3215.285 3221.193 3222.523 3176.026 36.958
      rmsea    0.069    0.076    0.082    0.083    0.026  0.038
      cfi      0.973    0.969    0.965    0.964    0.990  0.016
      tli      0.950    0.941    0.934    0.933    1.000  0.047
      srmr     0.038    0.041    0.044    0.044    0.025  0.012
========= Parameter Estimates and Standard Errors ============
       Estimate Average Estimate SD Average SE Power (Not equal 0) Std Est
f1=~y1            0.718       0.033      0.074                 1.0   0.724
f1=~y2            0.654       0.084      0.072                 1.0   0.675
f1=~y3            0.688       0.114      0.075                 1.0   0.683
f2=~y4            0.656       0.045      0.072                 1.0   0.676
f2=~y5            0.707       0.104      0.074                 1.0   0.702
f2=~y6            0.708       0.100      0.073                 1.0   0.719
f1~~f2            0.439       0.157      0.081                 1.0   0.439
y1~~y1            0.470       0.095      0.078                 1.0   0.474
y2~~y2            0.503       0.071      0.074                 1.0   0.540
y3~~y3            0.522       0.036      0.079                 1.0   0.529
y4~~y4            0.510       0.057      0.073                 1.0   0.542
y5~~y5            0.503       0.055      0.077                 1.0   0.505
y6~~y6            0.455       0.039      0.074                 1.0   0.480
y1~1              0.024       0.064      0.070                 0.0   0.024
y2~1              0.029       0.110      0.068                 0.2   0.030
y3~1              0.016       0.126      0.071                 0.2   0.012
y4~1             -0.068       0.071      0.069                 0.2  -0.070
y5~1             -0.029       0.056      0.071                 0.0  -0.031
y6~1             -0.018       0.086      0.069                 0.0  -0.018
       Std Est SD Std Ave SE Average Param Average Bias Coverage
f1=~y1      0.047      0.055          0.70        0.018      1.0
f1=~y2      0.073      0.057          0.70       -0.046      0.8
f1=~y3      0.074      0.056          0.70       -0.012      0.8
f2=~y4      0.035      0.056          0.70       -0.044      1.0
f2=~y5      0.057      0.055          0.70        0.007      0.8
f2=~y6      0.061      0.055          0.70        0.008      0.8
f1~~f2      0.157      0.081          0.50       -0.061      0.6
y1~~y1      0.069      0.080          0.51       -0.040      0.8
y2~~y2      0.096      0.076          0.51       -0.007      1.0
y3~~y3      0.096      0.077          0.51        0.012      1.0
y4~~y4      0.048      0.075          0.51        0.000      1.0
y5~~y5      0.082      0.077          0.51       -0.007      1.0
y6~~y6      0.083      0.078          0.51       -0.055      1.0
y1~1        0.064      0.071          0.00        0.024      1.0
y2~1        0.113      0.071          0.00        0.029      0.8
y3~1        0.126      0.071          0.00        0.016      0.8
y4~1        0.072      0.071          0.00       -0.068      0.8
y5~1        0.058      0.071          0.00       -0.029      1.0
y6~1        0.087      0.071          0.00       -0.018      1.0
========= Correlation between Fit Indices ============
       chisq    aic    bic  rmsea    cfi    tli   srmr
chisq  1.000 -0.021 -0.021  0.980 -0.970 -0.991  0.966
aic   -0.021  1.000  1.000 -0.059  0.097  0.027  0.176
bic   -0.021  1.000  1.000 -0.059  0.097  0.027  0.176
rmsea  0.980 -0.059 -0.059  1.000 -0.976 -0.951  0.937
cfi   -0.970  0.097  0.097 -0.976  1.000  0.933 -0.954
tli   -0.991  0.027  0.027 -0.951  0.933  1.000 -0.944
srmr   0.966  0.176  0.176  0.937 -0.954 -0.944  1.000
================== Replications =====================
Number of replications = 5 
Number of converged replications = 5 
Number of nonconverged replications: 
   1. Nonconvergent Results = 0 
   2. Nonconvergent results from multiple imputation = 0 
   3. At least one SE were negative or NA = 0 
   4. At least one variance estimates were negative = 0 
   5. At least one correlation estimates were greater than 1 or less than -1 = 0 
   6. Model-implied covariance matrices of any groups of latent variables are not positive definite = 0 
Progress: 1 / 5 
Progress: 2 / 5 
Progress: 3 / 5 
Progress: 4 / 5 
Progress: 5 / 5 
RESULT OBJECT
Model Type
[1] "lavaan"
========= Fit Indices Cutoffs ============
           Alpha
Fit Indices      0.1     0.05     0.01    0.001     Mean     SD
      chisq   17.320   18.701   19.806   20.054   12.645  4.598
      aic   3101.268 3112.605 3121.674 3123.715 3063.279 40.642
      bic   3144.146 3155.483 3164.552 3166.593 3106.157 40.642
      rmsea    0.075    0.081    0.086    0.087    0.048  0.027
      cfi      0.972    0.967    0.964    0.963    0.985  0.014
      tli      0.947    0.938    0.932    0.930    0.973  0.026
      srmr     0.047    0.050    0.052    0.052    0.038  0.009
========= Parameter Estimates and Standard Errors ============
       Estimate Average Estimate SD Average SE Power (Not equal 0) Std Est
f1=~y1            0.658       0.085      0.071                   1   0.678
f1=~y2            0.635       0.049      0.068                   1   0.684
f1=~y3            0.737       0.043      0.070                   1   0.762
f2=~y4            0.667       0.058      0.073                   1   0.678
f2=~y5            0.701       0.130      0.072                   1   0.709
f2=~y6            0.728       0.064      0.076                   1   0.709
y1~~y1            0.503       0.098      0.072                   1   0.536
y2~~y2            0.459       0.074      0.065                   1   0.531
y3~~y3            0.391       0.034      0.072                   1   0.419
y4~~y4            0.525       0.085      0.075                   1   0.539
y5~~y5            0.467       0.106      0.074                   1   0.489
y6~~y6            0.523       0.107      0.082                   1   0.495
f1~~f2            0.481       0.112      0.078                   1   0.481
       Std Est SD Std Ave SE Average Param Average Bias Coverage
f1=~y1      0.071      0.054          0.70       -0.042      1.0
f1=~y2      0.049      0.054          0.70       -0.065      1.0
f1=~y3      0.031      0.051          0.70        0.037      1.0
f2=~y4      0.034      0.056          0.70       -0.033      1.0
f2=~y5      0.098      0.054          0.70        0.001      0.6
f2=~y6      0.064      0.055          0.70        0.028      1.0
y1~~y1      0.095      0.073          0.49        0.013      0.8
y2~~y2      0.067      0.073          0.49       -0.031      0.8
y3~~y3      0.046      0.078          0.49       -0.099      1.0
y4~~y4      0.047      0.076          0.49        0.035      1.0
y5~~y5      0.134      0.075          0.49       -0.023      1.0
y6~~y6      0.095      0.077          0.49        0.033      1.0
f1~~f2      0.112      0.078          0.50       -0.019      0.8
========= Correlation between Fit Indices ============
       chisq    aic    bic  rmsea    cfi    tli   srmr
chisq  1.000  0.111  0.111  0.980 -0.996 -0.996  0.948
aic    0.111  1.000  1.000  0.220 -0.152 -0.152  0.322
bic    0.111  1.000  1.000  0.220 -0.152 -0.152  0.322
rmsea  0.980  0.220  0.220  1.000 -0.975 -0.975  0.916
cfi   -0.996 -0.152 -0.152 -0.975  1.000  1.000 -0.964
tli   -0.996 -0.152 -0.152 -0.975  1.000  1.000 -0.964
srmr   0.948  0.322  0.322  0.916 -0.964 -0.964  1.000
================== Replications =====================
Number of replications = 5 
Number of converged replications = 5 
Number of nonconverged replications: 
   1. Nonconvergent Results = 0 
   2. Nonconvergent results from multiple imputation = 0 
   3. At least one SE were negative or NA = 0 
   4. At least one variance estimates were negative = 0 
   5. At least one correlation estimates were greater than 1 or less than -1 = 0 
   6. Model-implied covariance matrices of any groups of latent variables are not positive definite = 0 
Progress: 1 / 6 
Progress: 2 / 6 
Progress: 3 / 6 
Progress: 4 / 6 
Progress: 5 / 6 
Progress: 6 / 6 
RESULT OBJECT
Model Type
[1] "lavaan"
========= Fit Indices Cutoffs ============
           Alpha
Fit Indices      0.1     0.05     0.01    0.001     Mean     SD
      chisq    0.000    0.000    0.000    0.000    0.000  0.000
      aic   1142.098 1145.983 1149.090 1149.790 1121.339 19.069
      bic   1151.993 1155.878 1158.985 1159.685 1131.234 19.069
      rmsea    0.000    0.000    0.000    0.000    0.000  0.000
      cfi      1.000    1.000    1.000    1.000    1.000  0.000
      tli      1.000    1.000    1.000    1.000    1.000  0.000
      srmr     0.000    0.000    0.000    0.000    0.000  0.000
========= Parameter Estimates and Standard Errors ============
       Estimate Average Estimate SD Average SE Power (Not equal 0) Std Est
y1~~y2           -0.078       0.091      0.068                 0.2  -0.079
y1~~y1            0.900       0.100      0.090                 1.0   1.000
y2~~y2            1.026       0.067      0.103                 1.0   1.000
       Std Est SD Std Ave SE Average Param Average Bias Coverage
y1~~y2      0.094       0.07             0       -0.078      0.8
y1~~y1      0.000       0.00             1       -0.100      0.8
y2~~y2      0.000       0.00             1        0.026      1.0
========= Correlation between Fit Indices ============
       chisq    aic    bic    cfi   srmr
chisq  1.000 -0.535 -0.535 -1.000  0.989
aic   -0.535  1.000  1.000  0.535 -0.610
bic   -0.535  1.000  1.000  0.535 -0.610
cfi   -1.000  0.535  0.535  1.000 -0.989
srmr   0.989 -0.610 -0.610 -0.989  1.000
================== Replications =====================
Number of replications = 5 
Number of converged replications = 5 
Number of nonconverged replications: 
   1. Nonconvergent Results = 0 
   2. Nonconvergent results from multiple imputation = 0 
   3. At least one SE were negative or NA = 0 
   4. At least one variance estimates were negative = 0 
   5. At least one correlation estimates were greater than 1 or less than -1 = 0 
   6. Model-implied covariance matrices of any groups of latent variables are not positive definite = 0 
Progress: 1 / 5 
Progress: 2 / 5 
Progress: 3 / 5 
Progress: 4 / 5 
Progress: 5 / 5 
RESULT OBJECT
Model Type
[1] "cfa"
========= Fit Indices Cutoffs ============
           Alpha
Fit Indices      0.1     0.05     0.01    0.001     Mean     SD
      chisq   16.166   17.613   18.770   19.031    8.543  6.920
      aic   3183.866 3198.673 3210.518 3213.184 3144.952 40.195
      bic   3246.534 3261.341 3273.186 3275.852 3207.620 40.195
      rmsea    0.069    0.076    0.082    0.083    0.026  0.038
      cfi      0.973    0.969    0.965    0.964    0.990  0.016
      tli      0.950    0.941    0.934    0.933    1.000  0.047
      srmr     0.038    0.041    0.044    0.044    0.025  0.012
========= Parameter Estimates and Standard Errors ============
       Estimate Average Estimate SD Average SE Power (Not equal 0) Std Est
f1=~y1            0.722       0.046      0.074                   1   0.724
f1=~y2            0.673       0.073      0.075                   1   0.675
f1=~y3            0.682       0.074      0.074                   1   0.683
f2=~y4            0.674       0.035      0.074                   1   0.676
f2=~y5            0.700       0.057      0.074                   1   0.702
f2=~y6            0.718       0.061      0.074                   1   0.719
f1~~f2            0.439       0.157      0.081                   1   0.439
y1~~y1            0.471       0.068      0.079                   1   0.474
y2~~y2            0.537       0.095      0.078                   1   0.540
y3~~y3            0.526       0.096      0.078                   1   0.529
y4~~y4            0.539       0.048      0.077                   1   0.542
y5~~y5            0.502       0.082      0.077                   1   0.505
y6~~y6            0.477       0.083      0.077                   1   0.480
y1~1              0.000       0.000      0.071                   0   0.000
y2~1              0.000       0.000      0.071                   0   0.000
y3~1              0.000       0.000      0.071                   0   0.000
y4~1              0.000       0.000      0.071                   0   0.000
y5~1              0.000       0.000      0.071                   0   0.000
y6~1              0.000       0.000      0.071                   0   0.000
       Std Est SD Std Ave SE Average Param Average Bias Coverage
f1=~y1      0.047      0.055          0.70        0.022      1.0
f1=~y2      0.073      0.057          0.70       -0.027      1.0
f1=~y3      0.074      0.056          0.70       -0.018      1.0
f2=~y4      0.035      0.056          0.70       -0.026      1.0
f2=~y5      0.057      0.055          0.70        0.000      1.0
f2=~y6      0.061      0.055          0.70        0.018      1.0
f1~~f2      0.157      0.081          0.50       -0.061      0.6
y1~~y1      0.069      0.080          0.51       -0.039      1.0
y2~~y2      0.096      0.076          0.51        0.027      0.8
y3~~y3      0.096      0.077          0.51        0.016      0.8
y4~~y4      0.048      0.075          0.51        0.029      1.0
y5~~y5      0.082      0.077          0.51       -0.008      1.0
y6~~y6      0.083      0.078          0.51       -0.033      1.0
y1~1        0.000      0.071          0.00        0.000      1.0
y2~1        0.000      0.071          0.00        0.000      1.0
y3~1        0.000      0.071          0.00        0.000      1.0
y4~1        0.000      0.071          0.00        0.000      1.0
y5~1        0.000      0.071          0.00        0.000      1.0
y6~1        0.000      0.071          0.00        0.000      1.0
========= Correlation between Fit Indices ============
       chisq    aic    bic  rmsea    cfi    tli   srmr
chisq  1.000 -0.371 -0.371  0.980 -0.970 -0.991  0.966
aic   -0.371  1.000  1.000 -0.196  0.188  0.489 -0.324
bic   -0.371  1.000  1.000 -0.196  0.188  0.489 -0.324
rmsea  0.980 -0.196 -0.196  1.000 -0.976 -0.951  0.937
cfi   -0.970  0.188  0.188 -0.976  1.000  0.933 -0.954
tli   -0.991  0.489  0.489 -0.951  0.933  1.000 -0.944
srmr   0.966 -0.324 -0.324  0.937 -0.954 -0.944  1.000
================== Replications =====================
Number of replications = 5 
Number of converged replications = 5 
Number of nonconverged replications: 
   1. Nonconvergent Results = 0 
   2. Nonconvergent results from multiple imputation = 0 
   3. At least one SE were negative or NA = 0 
   4. At least one variance estimates were negative = 0 
   5. At least one correlation estimates were greater than 1 or less than -1 = 0 
   6. Model-implied covariance matrices of any groups of latent variables are not positive definite = 0 
[[1]]
NULL

[[2]]
NULL

[[3]]
NULL

[[4]]
NULL

[[5]]
NULL

Progress: 1 / 5 
Progress: 2 / 5 
Progress: 3 / 5 
Progress: 4 / 5 
Progress: 5 / 5 
[[1]]
[1] -0.01218423

[[2]]
[1] -0.1084645

[[3]]
[1] 0.1592328

[[4]]
[1] 0.07325282

[[5]]
[1] 0.01852426

Progress: 1 / 6 
Progress: 2 / 6 
Progress: 3 / 6 
Progress: 4 / 6 
Progress: 5 / 6 
Progress: 6 / 6 
RESULT OBJECT
Model Type
[1] "function"
========= Fit Indices Cutoffs ============
           Alpha
Fit Indices      0.1     0.05     0.01    0.001     Mean    SD
     loglik -280.369 -280.261 -280.175 -280.155 -284.848 5.572
========= Parameter Estimates and Standard Errors ============
            Estimate Average Estimate SD Average SE Power (Not equal 0)
(Intercept)            0.056       0.081      0.072                 0.2
y1                    -0.085       0.104      0.076                 0.2
            Average Param Average Bias Coverage
(Intercept)         0.002        0.054      0.8
y1                 -0.002       -0.083      0.8
================== Replications =====================
Number of replications = 5 
Number of converged replications = 5 
Number of nonconverged replications: 
   1. Nonconvergent Results = 0 
   2. Nonconvergent results from multiple imputation = 0 
   3. At least one SE were negative or NA = 0 
   4. At least one variance estimates were negative = 0 
   5. At least one correlation estimates were greater than 1 or less than -1 = 0 
   6. Model-implied covariance matrices of any groups of latent variables are not positive definite = 0 

simsem documentation built on March 29, 2021, 1:07 a.m.

Related to sim in simsem...