View source: R/multiple_imputation_da.R
modsem_mimpute | R Documentation |
modsem
model using multiple imputationEstimate a modsem
model using multiple imputation
modsem_mimpute(
model.syntax,
data,
method = "lms",
m = 25,
verbose = interactive(),
se = c("simple", "full"),
...
)
model.syntax |
|
data |
A dataframe with observed variables used in the model. |
method |
Method to use:
|
m |
Number of imputations to perform. More imputations will yield better estimates but can also be (a lot) slower. |
verbose |
Should progress be printed to the console? |
se |
How should corrected standard errors be computed? Alternatives are:
|
... |
Arguments passed to |
modsem_impute
is currently only available for the DA approaches
(LMS and QML). It performs multiple imputation using Amelia::amelia
and returns aggregated coefficients from the multiple imputations, along with
corrected standard errors.
m1 <- '
# Outer Model
X =~ x1 + x2 +x3
Y =~ y1 + y2 + y3
Z =~ z1 + z2 + z3
# Inner model
Y ~ X + Z + X:Z
'
oneInt2 <- oneInt
set.seed(123)
k <- 200
I <- sample(nrow(oneInt2), k, replace = TRUE)
J <- sample(ncol(oneInt2), k, replace = TRUE)
for (k_i in seq_along(I)) oneInt2[I[k_i], J[k_i]] <- NA
## Not run:
est <- modsem_mimpute(m1, oneInt2, m = 25)
summary(est)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.