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 |
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 |
type |
The type of the confidence intervals. If est to |
... |
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)