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

lavNames

lavaan Names


Description

Extract variables names from a fitted lavaan object.

Usage

lavNames(object, type = "ov", ...)

Arguments

object

An object of class lavaan.

type

Character. The type of variables whose names should be extracted. See details for a complete list.

...

Additional selection variables. For example "group = 2L" (in a multiple-group analysis) only considers the variables included in the model for the second group.

Details

The order of the variable names, as returned by lavNames determines the order in which the variables are listed in the parameter table, and therefore also in the summary output.

The following variable types are available:

  • "ov": observed variables

  • "ov.x": (pure) exogenous observed variables (no mediators)

  • "ov.nox": non-exogenous observed variables

  • "ov.model": modelled observed variables (joint vs conditional)

  • "ov.y": (pure) endogenous variables (dependent only) (no mediators)

  • "ov.num": numeric observed variables

  • "ov.ord": ordinal observed variables

  • "ov.ind": observed indicators of latent variables

  • "ov.orphan": lonely observed variables (only intercepts/variancesappear in the model syntax)

  • "ov.interaction": interaction terms (defined by the colon operator)

  • "th": threshold names ordinal variables only

  • "th.mean": threshold names ordinal + numeric variables (if any)

  • "lv": latent variables

  • "lv.regular": latent variables (defined by =~ only)

  • "lv.formative": latent variables (defined by <~ only)

  • "lv.x": (pure) exogenous variables

  • "lv.y": (pure) endogenous variables

  • "lv.nox": non-exogenous latent variables

  • "lv.nonnormal": latent variables with non-normal indicators

  • "lv.interaction": interaction terms at the latent level

  • "eqs.y": variables that appear as dependent variables in a regression formula (but not indicators of latent variables)

  • "eqs.x": variables that appear as independent variables in a regression formula

See Also

Examples

HS.model <- ' visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 '

fit <- cfa(HS.model, data=HolzingerSwineford1939)
lavNames(fit, "ov")

lavaan

Latent Variable Analysis

v0.6-10
GPL (>= 2)
Authors
Yves Rosseel [aut, cre] (<https://orcid.org/0000-0002-4129-4477>), Terrence D. Jorgensen [aut] (<https://orcid.org/0000-0001-5111-6773>), Nicholas Rockwood [aut] (<https://orcid.org/0000-0001-5931-183X>), Daniel Oberski [ctb], Jarrett Byrnes [ctb], Leonard Vanbrabant [ctb], Victoria Savalei [ctb], Ed Merkle [ctb], Michael Hallquist [ctb], Mijke Rhemtulla [ctb], Myrsini Katsikatsou [ctb], Mariska Barendse [ctb], Florian Scharf [ctb], Han Du [ctb]
Initial release

We don't support your browser anymore

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