confint.cond_effect {stdmod}R Documentation

Confidence Intervals for a 'cond_effect' Class Object

Description

Return the confidence intervals of estimates conditional effect in the output of cond_effect() or cond_effect_boot().

Usage

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

Arguments

object

The output of cond_effect() or cond_effect_boot().

parm

Ignored by this function. The confidence intervals for all available levels will be returned.

level

The level of confidence. For the confidence intervals returned by lm(), default is .95, i.e., 95%. For the bootstrap percentile confidence intervals, default is the level used in calling cond_effect_boot().

type

The type of the confidence intervals. If est to "lm", returns the confidence interval given by the confint() method of lm(). If set to "boot", the bootstrap percentile confidence intervals are returned. Default is "boot" if bootstrap estimates are stored in object, and "lm" if bootstrap estimates are not stored.

...

Additional arguments. Ignored.

Details

If bootstrapping is used to form the confidence interval by cond_effect_boot(), users can request the percentile confidence intervals of the bootstrap estimates. This method does not do the bootstrapping itself.

Value

A matrix of the confidence intervals.

Author(s)

Shu Fai Cheung https://orcid.org/0000-0002-9871-9448

Examples


# Load a sample data set

dat <- test_x_1_w_1_v_1_cat1_n_500

# Do a moderated regression by lm
lm_raw <- lm(dv ~ iv*mod + v1 + cat1, dat)
summary(lm_raw)
out <- cond_effect(lm_raw, x = iv, w = mod)
print(out, t_ci = TRUE)
confint(out)

lm_std <- std_selected(lm_raw, to_center = ~ iv + mod, to_scale = ~ iv + mod)
# Alternative: use to_standardize as a shortcut
# lm_std <- std_selected(lm_raw, to_standardize = ~ iv + mod)
out <- cond_effect(lm_std, x = iv, w = mod)
print(out, t_ci = TRUE)
confint(out)

# Categorical moderator
lm_cat <- lm(dv ~ iv*cat1 + v1, dat)
summary(lm_cat)
out <- cond_effect(lm_cat, x = iv, w = cat1)
print(out, t_ci = TRUE)
confint(out)


[Package stdmod version 0.2.10 Index]