get_cibound: A 'cibound' Output From a 'semlbci' Object

View source: R/get_cibound.R

get_ciboundR Documentation

A 'cibound' Output From a 'semlbci' Object

Description

Get the cibound output of a bound from a semlbci object, the output of semlbci().

Usage

get_cibound(x, row_id, which = c("lbound", "ubound"))

get_cibound_status_not_0(x)

Arguments

x

The output of semlbci().

row_id

The row number in x. Should be the number on the left, not the actual row number, because some rows may be omitted in the printout of x.

which

The bound for which the ci_bound_wn_i() is to be extracted. Either "lbound" or "ubound".

Details

The function get_cibound() returns the original output of ci_bound_wn_i() for a bound. Usually for diagnosis.

The function get_cibound_status_not_0() checks the status code of each bound, and returns the cibound outputs of bounds with status code not equal to zero (i.e., something wrong in the search). Printing it can print the diagnostic information for all bounds that failed in the search.

Value

get_cibound() returns a cibound-class object. See ci_bound_wn_i() for details. get_cibound_status_not_0() returns a list of cibound-class objects with status not equal to zero. If all bounds have status equal to zero, it returns an empty list.

Author(s)

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

See Also

semlbci()

Examples


library(lavaan)
mod <-
"
m ~ a*x
y ~ b*m
ab := a * b
"
fit_med <- sem(mod, simple_med, fixed.x = FALSE)
p_table <- parameterTable(fit_med)
p_table
lbci_med <- semlbci(fit_med,
                    pars = c("ab :="))
lbci_med

# Get the output of ci_bound_wn_i() of the lower
# bound of the LBCI for the indirect effect:
get_cibound(lbci_med, row_id = 6, which = "lbound")

# Get the output of ci_bound_wn_i() of the upper
# bound of the LBCI for the indirect effect:
get_cibound(lbci_med, row_id = 6, which = "ubound")


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