confint.cond_indirect_effects {manymome}R Documentation

Confidence Intervals of Indirect Effects or Conditional Indirect Effects

Description

Return the confidence intervals of the conditional indirect effects or conditional effects in the output of cond_indirect_effects().

Usage

## S3 method for class 'cond_indirect_effects'
confint(object, parm, level = 0.95, ...)

Arguments

object

The output of cond_indirect_effects().

parm

Ignored. Always returns the confidence intervals of the effects for all levels stored.

level

The level of confidence, default is .95, returning the 95% confidence interval. Ignored for now and will use the level of the stored intervals.

...

Additional arguments. Ignored by the function.

Details

It extracts and returns the columns for confidence intervals, if available.

The type of confidence intervals depends on the call used to compute the effects. This function merely retrieves the confidence intervals stored, if any, which could be formed by nonparametric bootstrapping, Monte Carlo simulation, or other methods to be supported in the future.

Value

A data frame with two columns, one for each confidence limit of the confidence intervals. The number of rows is equal to the number of rows of object.

See Also

cond_indirect_effects()

Examples


library(lavaan)
dat <- modmed_x1m3w4y1
mod <-
"
m1 ~ x  + w1 + x:w1
m2 ~ m1
y  ~ m2 + x + w4 + m2:w4
"
fit <- sem(mod, dat, meanstructure = TRUE, fixed.x = FALSE, se = "none", baseline = FALSE)
est <- parameterEstimates(fit)

# Examples for cond_indirect():

# Create levels of w1 and w4
w1levels <- mod_levels("w1", fit = fit)
w1levels
w4levels <- mod_levels("w4", fit = fit)
w4levels
w1w4levels <- merge_mod_levels(w1levels, w4levels)

# Conditional effects from x to m1 when w1 is equal to each of the levels
# R should be at least 2000 or 5000 in real research.
out1 <- suppressWarnings(cond_indirect_effects(x = "x", y = "m1",
                      wlevels = w1levels, fit = fit,
                      boot_ci = TRUE, R = 20, seed = 54151,
                      parallel = FALSE,
                      progress = FALSE))
confint(out1)



[Package manymome version 0.2.1 Index]