Learn R Programming

semlbci (version 0.11.5)

nearby_levels: 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))

Value

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

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.

See Also

semlbci(), ci_order()

Examples

Run this code

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)

Run the code above in your browser using DataLab