umx_is_GSEM: umx_is_GSEM

View source: R/umxGSEM.R

umx_is_GSEMR Documentation

umx_is_GSEM

Description

Utility function returning a binary answer to the question "Is this a GSEM model?"

Usage

umx_is_GSEM(obj)

Arguments

obj

an object to be tested to see if it is an OpenMx GSEM OpenMx::mxModel()

Details

TRUE only for models of class MxModelGSEM (the class umxGSEM() assigns). Ordinary RAM / umxRAM models are FALSE (they used to match via a leftover MxRAMObjective check).

Value

  • Boolean

References

https://github.com/tbates/umx

See Also

Other Test: umx_check(), umx_check_OS(), umx_check_model(), umx_check_names(), umx_has_CIs(), umx_has_been_run(), umx_has_means(), umx_has_square_brackets(), umx_is_LISREL(), umx_is_MxData(), umx_is_MxMatrix(), umx_is_MxModel(), umx_is_RAM(), umx_is_cov()

Examples

## Not run: 
require(umx)
# LDSC object (list with V, S, I, N, m)
data(Psych_LDSC)

m1 = umxGSEM(model = "F1 ~= SCZ + BIP + MDD + EA + INSOM",
             covstruc = Psych_LDSC, estimation = "DWLS")
umx_is_GSEM(m1) # TRUE

# lavaan-style paths (quote the model string carefully)
m2 = umxGSEM(
  model = "F1 =~ SCZ + BIP + MDD\nINSOM ~ F1\nEA ~ INSOM",
  covstruc = Psych_LDSC, estimation = "DWLS")
umxCompare(m2, m1)

# Hand-built S/V heritability + genetic covariance
traits = c("Trt1", "Trt2")
S = matrix(c(0.25, 0.15, 0.15, 0.30), nrow = 2, ncol = 2,
           dimnames = list(traits, traits))
V = diag(c(0.002, 0.003, 0.002))
vech_names = c("Trt1 Trt1", "Trt2 Trt1", "Trt2 Trt2")
dimnames(V) = list(vech_names, vech_names)
modelStr = "Trt1 ~~ Trt1\nTrt2 ~~ Trt2\nTrt1 ~~ Trt2"
m0 = umxGSEM(model = modelStr, S = S, V = V, estimation = "DWLS")
umx_is_GSEM(m0)

## End(Not run)

umx documentation built on Oct. 11, 2026, 5:07 p.m.