View source: R/set_constraint.R
set_constraint | R Documentation |
Create the equality constraint for finding the likelihood-based confidence interval (LBCI) by the Wu-Neale-2012 method.
set_constraint(sem_out, ciperc = 0.95)
sem_out |
The SEM output. Currently supports lavaan::lavaan outputs only. |
ciperc |
The intendeted coverage probability of the confidence interval. Default is .95. |
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.
The Wu-Neale-2012 method uses a simple objective function that is
optimized with an equality constraint. set_constraint()
generates
the equality constraint function to be used by ci_bound_wn_i()
.
It currently supports lavaan::lavaan outputs only.
An equality constraint function to be used by ci_bound_wn_i()
.
library(lavaan)
data(simple_med)
dat <- simple_med
mod <-
"
m ~ x
y ~ m
"
fit_med <- sem(mod, simple_med, fixed.x = FALSE)
fn_constr0 <- set_constraint(fit_med)
out <- fn_constr0(coef(fit_med), sem_out = fit_med)
out
lavTech(fit_med, "optim")$fx
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.