MCMI {semmcci}R Documentation

Monte Carlo Confidence Intervals (Multiple Imputation)

Description

Calculates Monte Carlo confidence intervals for free and defined parameters. Missing values are handled using multilple imputation.

Usage

MCMI(
  lav,
  mi,
  R = 20000L,
  alpha = c(0.001, 0.01, 0.05),
  decomposition = "eigen",
  pd = TRUE,
  tol = 1e-06,
  seed = NULL
)

Arguments

lav

Object of class lavaan.

mi

Object of class mids (output of mice::mice()), object of class amelia (output of Amelia::amelia()), or a list of multiply imputed data sets.

R

Positive integer. Number of Monte Carlo replications.

alpha

Numeric vector. Significance level \alpha.

decomposition

Character string. Matrix decomposition of the sampling variance-covariance matrix for the data generation. If decomposition = "chol", use Cholesky decomposition. If decomposition = "eigen", use eigenvalue decomposition. If decomposition = "svd", use singular value decomposition.

pd

Logical. If pd = TRUE, check if the sampling variance-covariance matrix is positive definite using tol.

tol

Numeric. Tolerance used for pd.

seed

Integer. Random seed for reproducibility.

Details

A sampling distribution of parameter estimates is generated from the multivariate normal distribution using the parameter estimates and the sampling variance-covariance matrix obtained using multiple imputation. Confidence intervals for free and defined parameters are generated using the simulated sampling distribution. Parameters can be defined using the ⁠:=⁠ operator in the lavaan model syntax.

Value

Returns an object of class semmcci which is a list with the following elements:

call

Function call.

args

List of function arguments.

thetahat

Parameter estimates \hat{\theta}.

thetahatstar

Sampling distribution of parameter estimates \hat{\theta}^{\ast}.

fun

Function used ("MCMI").

References

Pesigan, I. J. A., & Cheung, S. F. (2023). Monte Carlo confidence intervals for the indirect effect with missing data. Behavior Research Methods. doi:10.3758/s13428-023-02114-4

Rubin, D. B. (1987). Multiple imputation for nonresponse in surveys. John Wiley & Sons, Inc.

See Also

Other Monte Carlo in Structural Equation Modeling Functions: Func(), MC(), MCFunc(), MCGeneric(), MCStd()

Examples

library(semmcci)
library(lavaan)

# Data ---------------------------------------------------------------------
data("Tal.Or", package = "psych")
df <- mice::ampute(Tal.Or)$amp

# Monte Carlo (Multiple Imputation) ----------------------------------------
## Multiple Imputation -----------------------------------------------------
mi <- mice::mice(
  data = df,
  print = FALSE,
  m = 5L, # use a large value e.g., 100L for actual research,
  seed = 42
)

## Fit Model in lavaan -----------------------------------------------------
model <- "
  reaction ~ cp * cond + b * pmi
  pmi ~ a * cond
  cond ~~ cond
  indirect := a * b
  direct := cp
  total := cp + (a * b)
"
fit <- sem(data = df, model = model) # use default listwise deletion

## MCMI() ------------------------------------------------------------------
MCMI(
  fit,
  mi = mi,
  R = 5L, # use a large value e.g., 20000L for actual research
  alpha = 0.05
)


[Package semmcci version 1.1.4 Index]