Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

umx_check_model

Check for required features in an OpenMx.


Description

Allows the user to straight-forwardly require a specific model type (i.e., "RAM", "LISREL", etc.), whether or not the model has data, if it has been run or not. You can also test whether is has a means model or not and (in future) test if it has submodels.

Usage

umx_check_model(
  obj,
  type = NULL,
  hasData = NULL,
  beenRun = NULL,
  hasMeans = NULL,
  checkSubmodels = FALSE,
  callingFn = "a function"
)

Arguments

obj

an object to check

type

what type the model must be, i.e., "RAM", "LISREL", etc. (defaults to not checking NULL)

hasData

whether the model should have data or not (defaults to not checking NULL)

beenRun

whether the model has been run or not (defaults to not checking NULL)

hasMeans

whether the model should have a means model or not (defaults to not checking NULL)

checkSubmodels

whether to check submodels (not implemented yet) (default = FALSE)

callingFn

= Name of the calling function to help the user locate the error.

Value

- boolean

References

- <https://github.com/tbates/umx>

See Also

Examples

require(umx)
data(demoOneFactor)
manifests = names(demoOneFactor)
m1 = umxRAM("check_model_ex", data = demoOneFactor, type = "cov",
	umxPath("G", to = manifests),
	umxPath(var = manifests),
	umxPath(var = "G", fixedAt = 1)
)#'
umx_check_model(m1) # TRUE, this is a model
umx_check_model(m1, type = "RAM") # equivalent to umx_is_RAM()
umx_check_model(m1, hasData = TRUE)


## Not run: 
umx_check_model(m1, hasMeans = TRUE)
umx_check_model(m1, beenRun = FALSE)
# Model with no data
m1 = umxRAM("x ~~ .3*y", autoRun = FALSE)
umx_check_model(m1, hasData = TRUE)

## End(Not run)

umx

Structural Equation Modeling and Twin Modeling in R

v4.10.10
GPL-3
Authors
Timothy C. Bates [aut, cre] (<https://orcid.org/0000-0002-1153-9007>), Gillespie Nathan [wit], Michael Zakharin [wit], Brenton Wiernik [ctb], Joshua N. Pritikin [ctb], Michael C. Neale [ctb], Hermine Maes [ctb]
Initial release
2021-11-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.