nearby_levels: LBCI Bounds of Nearby Levels of Confidence

View source: R/nearby_levels.R

nearby_levelsR Documentation

LBCI Bounds of Nearby Levels of Confidence

Description

Find LBCIs with levels of confidence different from those stored in a semlbci- class object.

Usage

nearby_levels(x, ciperc_levels = c(-0.025, 0.025), ciperc_range = c(0.6, 0.99))

Arguments

x

The output of semlbci().

ciperc_levels

A numeric vector of deviations from the original level of confidence. The default is c(-.025, .025). Therefore, if the original level is .95, the levels to be used is c(-.025, .025) + .95 or c(.925, .975).

ciperc_range

A numeric vector of two numbers, which are the minimum and maximum levels of confidence to be used, respectively. Default is c(.60, .99).

Details

It receives a semlbci-class object, gets the original level of confidence, generates one or more levels of confidence different from this level by certain amounts, and repeats the original call to semlbci() with these levels of confidence. The results are returned as a list of class semlbci_list, with the originalsemlbci-class included.

Value

A semlbci_list-class object, which is simply a named list of semlbci-class object, names being the levels of confidence.

Author(s)

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

See Also

semlbci(), ci_order()

Examples


library(lavaan)
mod <-
"
m ~ x
y ~ m
"
fit_med <- sem(mod, simple_med, fixed.x = FALSE)
lbci_fit <- semlbci(fit_med)
lbci_fit_nb <- nearby_levels(lbci_fit,
                             ciperc_levels = c(-.050, .050))
names(lbci_fit_nb)
# Check the order of the confidence bounds.
# A confidence interval with a higher level of confidence
# should enclose a confidence interval with
# a lower level of confidence.
ci_order(lbci_fit_nb)


semlbci documentation built on June 22, 2024, 10:55 a.m.