draw
, called a code{paramSet}. This function can export data to be analyzed with either Mplus or LISREL.exportData(nRep, model, n, program = "Mplus", fileStem = "sim", miss = NULL, missCode = -999, datafun=NULL,
pmMCAR = NULL, pmMAR = NULL, facDist = NULL, indDist = NULL, errorDist = NULL, sequential = FALSE,
modelBoot = FALSE, realData = NULL, maxDraw = 50, misfitType = "f0",
misfitBounds = NULL, averageNumMisspec = NULL, optMisfit=NULL, optDraws = 50,
seed = 123321, silent = FALSE, multicore = FALSE, numProc = NULL, params = FALSE)
NULL
and specify n
, pmMCAR
, and pmMAR
SimSem
object created by model
. Will be used to generate data and analyze it.miss
.pmMCAR
here is a vector of percent missing, which the values can be in betweenpmMAR
here is a vector of percent missing, which the values can be in between 0 and 1 only. The specSimDataDist
object or list of objects for the distribution of factors. If one object is passed, all factors will have the same distribution. Use when sequential
is TRUE
.SimDataDist
object or list of objects for a distribution of indicators. If one object is passed, each indicator will have the same distribution. Use when sequential
is FALSE
.SimDataDist
indicating the distribution of errors. If a single SimDataDist
is specified, each error will be genrated with that distribution.TRUE
, use a sequential method to create data such that the data from factor are generated first and apply to a set of equations to obtain the data of indicators. If FALSE
, create data directly from model-implied mean and covardraw
for further information. This argument requires real data to be passed to realData
.TRUE
, the provided fit will be divided by the number of misspecified parameters.TRUE
, suppress warnings.NULL
, the package will find the maximum number of processors.TRUE
, the parameters from each replication will be returned.program
= "Mplus" one file is output for each replication, and an extra file is output with the names of all saved data sets (this file can be used with the MONTECARLO command in Mplus). If program
= "LISREL" one file is output with each replication stacked on top of the next (this file can be used with the RP command in LISREL). If program
= TRUE
, a list of parameter values for each replication is returned.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")
## Export 20 replications to an external data file (not run).
#exportData(20, CFA.Model, 200)
Run the code above in your browser using DataLab