View source: R/xxx_lavaanList.R
lavaanList | R Documentation |
Fit the same latent variable model, for a (potentially large) number of datasets.
lavaanList(model = NULL, dataList = NULL, dataFunction = NULL,
dataFunction.args = list(), ndat = length(dataList), cmd = "lavaan",
..., store.slots = c("partable"), FUN = NULL, show.progress = FALSE,
store.failed = FALSE, parallel = c("no", "multicore", "snow"),
ncpus = max(1L, parallel::detectCores() - 1L), cl = NULL, iseed = NULL)
semList(model = NULL, dataList = NULL, dataFunction = NULL,
dataFunction.args = list(), ndat = length(dataList),
..., store.slots = c("partable"), FUN = NULL, show.progress = FALSE,
store.failed = FALSE, parallel = c("no", "multicore", "snow"),
ncpus = max(1L, parallel::detectCores() - 1L), cl = NULL, iseed = NULL)
cfaList(model = NULL, dataList = NULL, dataFunction = NULL,
dataFunction.args = list(), ndat = length(dataList),
..., store.slots = c("partable"), FUN = NULL, show.progress = FALSE,
store.failed = FALSE, parallel = c("no", "multicore", "snow"),
ncpus = max(1L, parallel::detectCores() - 1L), cl = NULL, iseed = NULL)
model |
A description of the user-specified model. Typically, the model
is described using the lavaan model syntax. See
|
dataList |
List. Each element contains a full data frame containing the observed variables used in the model. |
dataFunction |
Function. A function that generated a full data frame containing the observed variables used in the model. It can also be a matrix, if the columns are named. |
dataFunction.args |
List. Optional list of arguments that are passed
to the |
ndat |
Integer. The number of datasets that should be generated using
the |
cmd |
Character. Which command is used to run the sem models. The possible
choices are |
... |
Other named arguments for |
store.slots |
Character vector. Which slots (from a lavaan object)
should be stored for each dataset? The possible choices are
|
FUN |
Function. A function which when applied to the
|
store.failed |
Logical. If |
parallel |
The type of parallel operation to be used (if any). If
missing, the default is |
ncpus |
Integer. The number of processes to be used in parallel operation: typically one would chose this to the number of available CPUs. |
cl |
An optional parallel or snow cluster for use if
|
iseed |
An integer to set the seed. Or NULL if no reproducible seeds are
needed. To make this work, make sure the first
RNGkind() element is |
show.progress |
If |
An object of class lavaanList
, for which several methods
are available, including a summary
method.
class lavaanList
# The Holzinger and Swineford (1939) example
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
# a data generating function
generateData <- function() simulateData(HS.model, sample.nobs = 100)
set.seed(1234)
fit <- semList(HS.model, dataFunction = generateData, ndat = 5,
store.slots = "partable")
# show parameter estimates, per dataset
coef(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.