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

detectVariables

Automatically detect variables from an Mplus model object


Description

This is a function to automatically detect the variables used in an Mplus model object.

Usage

detectVariables(object)

Arguments

object

An Mplus model object from mplusObject.#'

Value

A vector of variables from the R dataset to use.

Author(s)

Joshua F. Wiley <jwiley.psych@gmail.com>

See Also

Examples

example1 <- mplusObject(MODEL = "mpg ON wt;",
  rdata = mtcars, autov = FALSE)
example1$usevariables
MplusAutomation:::detectVariables(example1)

example2 <- mplusObject(MODEL = "mpg ON wt;",
  rdata = mtcars, autov = TRUE)
example2$usevariables
example3 <- update(example2,
  MODEL = ~ . + "mpg ON qsec; wt WITH qsec;",
  autov = TRUE)
example3$usevariables
rm(example1, example2, example3)

MplusAutomation

An R Package for Facilitating Large-Scale Latent Variable Analyses in Mplus

v0.8
LGPL-3
Authors
Michael Hallquist [aut, cre], Joshua Wiley [aut], Caspar van Lissa [ctb], Daniel Morillo [ctb]
Initial release
2020-09-28

We don't support your browser anymore

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