check_sem_out {semlbci}R Documentation

Pre-analysis Check For 'semlbci'

Description

Check the output passed to semlbci()

Usage

check_sem_out(
  sem_out,
  robust = c("none", "satorra.2000"),
  multigroup_ok = TRUE
)

Arguments

sem_out

The output from an SEM analysis. Currently only supports a lavaan::lavaan object.

robust

Whether the LBCI based on robust likelihood ratio test is to be found. Only "satorra.2000" in lavaan::lavTestLRT() is supported for now. If "none", the default, then likelihood ratio test based on maximum likelihood estimation will be used.

multigroup_ok

If TRUE, will not check whether the model is a multiple-group model. Default is TRUE.

Details

It checks whether the model and the estimation method in the sem_out object passed to semlbci() are supported by the current version of semlbci(). This function is to be used by semlbci() but is exported such that the compatibility of an SEM output can be checked directly.

Estimation methods (estimator in lavaan::lavaan()) currently supported:

Estimation methods not yet supported:

Models supported:

Models not tested:

Models not yet supported:

Value

A numeric vector of one element. If 0, the model and estimation method are officially supported. If larger than zero, then the model and method are not officially supported but users can still try to use semlbci() on it at their own risks. If less than zero, then the model and/or the method are officially not supported.

The attributes info contains the reason for a value other than zero.

See Also

semlbci(), ci_i_one()

Examples

library(lavaan)
data(cfa_two_factors)
mod <-
"
f1 =~ x1 + x2 + x3
f2 =~ x4 + x5 + x6
"

fit <- sem(mod, cfa_two_factors)

# Should be 0
check_sem_out(fit)

fit2 <- sem(mod, cfa_two_factors, estimator = "DWLS")

# Should be negative because DWLS is officially not supported
check_sem_out(fit2)

fit3 <- sem(mod, cfa_two_factors, estimator = "MLR")

# Should be negative because MLR is supported only if
# robust is set to "satorra.2000"
check_sem_out(fit3)

# Should be zero because robust is set to "satorra.2000"
check_sem_out(fit3, robust = "satorra.2000")


[Package semlbci version 0.11.2 Index]