print.semmcci {semmcci} | R Documentation |
Print Method for Object of Class semmcci
Description
Print Method for Object of Class semmcci
Usage
## S3 method for class 'semmcci'
print(x, alpha = NULL, digits = 4, ...)
Arguments
x |
an object of class |
alpha |
Numeric vector.
Significance level |
digits |
Integer indicating the number of decimal places to display. |
... |
further arguments. |
Value
Returns a matrix of estimates, standard errors, number of Monte Carlo replications, and confidence intervals.
Author(s)
Ivan Jacob Agaloos Pesigan
Examples
library(semmcci)
library(lavaan)
# Data ---------------------------------------------------------------------
data("Tal.Or", package = "psych")
df <- mice::ampute(Tal.Or)$amp
# Monte Carlo --------------------------------------------------------------
## 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, missing = "fiml")
## MC() --------------------------------------------------------------------
unstd <- MC(
fit,
R = 5L # use a large value e.g., 20000L for actual research
)
## Standardized Monte Carlo ------------------------------------------------
std <- MCStd(unstd)
print(unstd)
print(std)
# 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 -----------------------------------------------------
fit <- sem(data = df, model = model) # use default listwise deletion
## MCMI() ------------------------------------------------------------------
unstd <- MCMI(
fit,
mi = mi,
R = 5L # use a large value e.g., 20000L for actual research
)
## Standardized Monte Carlo ------------------------------------------------
std <- MCStd(unstd)
print(unstd)
print(std)
[Package semmcci version 1.1.4 Index]