ci_i_one | R Documentation |
Find the likelihood-based confidence bound for one parameter.
ci_i_one(
i,
which = NULL,
sem_out,
method = c("wn", "ur"),
standardized = FALSE,
robust = "none",
sf_full = NA,
sf_args = list(),
sem_out_name = NULL,
try_k_more_times = 0,
...
)
i |
The position (row number) of the target parameters as appeared in the parameter table of the lavaan::lavaan object. |
which |
Whether the lower bound or the upper bound is to be
found. Must be |
sem_out |
The SEM output. Currently supports lavaan::lavaan outputs only. |
method |
The approach to be used. Default is |
standardized |
Logical. Whether the bound of the LBCI of the
standardized solution is to be searched. Default is |
robust |
Whether the LBCI based on robust likelihood ratio
test is to be found. Only |
sf_full |
A list with the scaling and shift factors. Ignored
if |
sf_args |
The list of arguments to be used for computing scaling factors
if |
sem_out_name |
The name of the object supplied to |
try_k_more_times |
How many more times to try if the status code is not zero. Default is 0. |
... |
Arguments to be passed to the function corresponds to
the requested method ( |
This function is not supposed to be used directly by users in
typical scenarios. Its interface is user-unfriendly because it
should be used through semlbci()
. It is exported such that
interested users can examine how a confidence bound is found, or
use it for experiments or simulations.
ci_i_one()
is the link between semlbci()
and the lowest level
function (currently ci_bound_wn_i()
). When called by semlbci()
to find the bound of a parameter, ci_i_one()
calls a function
(ci_bound_wn_i()
by default) one or more times to find the bound
(limit) for a likelihood-based confidence interval.
A list of the following elements.
bound
: The bound located. NA
if the search failed.
diags
: Diagnostic information.
method
: Method used. Currently only "wn"
is the only possible
value.
times
: Total time used in the search.
sf_full
: The scaling and shift factors used.
ci_bound_i_out
: The original output from ci_bound_wn_i()
.
attempt_lb_var
: How many attempts used to reduce the lower
bounds of free variances.
attempt_more_times
: How many additional attempts used to search
for the bounds. Controlled by
try_k_more_times
.
semlbci()
, ci_bound_wn_i()
data(simple_med)
library(lavaan)
mod <-
"
m ~ x
y ~ m
"
fit_med <- lavaan::sem(mod, simple_med, fixed.x = FALSE)
parameterTable(fit_med)
# Find the LBCI for the first parameter
# The method "wn" needs the constraint function.
# Use set_constraint() to generate this function:
fn_constr0 <- set_constraint(fit_med)
# Call ci_i to find the bound, the lower bound in this example.
# The constraint function, assigned to f_constr, is passed
# to ci_bound_wn_i().
# npar is an argument for ci_bound_wn_i().
out <- ci_i_one(i = 1,
which = "lbound",
sem_out = fit_med,
npar = 5,
f_constr = fn_constr0)
out$bounds
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.