Learn R Programming

semTools (version 0.5-3)

measEq.syntax-class: Class for Representing a Measurement-Equivalence Model

Description

This class of object stores information used to automatically generate lavaan model syntax to represent user-specified levels of measurement equivalence/invariance across groups and/or repeated measures. See measEq.syntax for details.

Usage

# S4 method for measEq.syntax
as.character(x, package = "lavaan",
  params = NULL, single = TRUE, groups.as.blocks = FALSE)

# S4 method for measEq.syntax show(object)

# S4 method for measEq.syntax summary(object, verbose = TRUE)

# S4 method for measEq.syntax update(object, ..., evaluate = TRUE, change.syntax = NULL)

Arguments

x, object

an object of class measEq.syntax

package

character indicating the package for which the model syntax should be generated. Currently, only "lavaan" and "mplus" are supported.

params

character vector indicating which type(s) of parameter to print syntax for. Must match a type that can be passed to group.equal or long.equal, but "residual.covariances" and "lv.covariances" will be silently ignored. Instead, requesting "residuals" or "lv.variances" will return covariances along with variances. By default (NULL), all types are printed.

single

logical indicating whether to concatenate lavaan model.syntax into a single character string. Setting FALSE will return a vector of strings, which may be convenient (or even necessary to prevent an error) in models with long variable names, many variables, or many groups.

groups.as.blocks

logical indicating whether to write lavaan model.syntax using vectors of labels and values for multiple groups (the default: FALSE), or whether to write a separate "block" of syntax per group. The block structure could allow users to apply the generated multigroup syntax (after some editing) to test invariance across levels in a multilevel SEM (see final example on measEq.syntax help page).

verbose

logical indicating whether to print a summary to the screen (default). If FALSE, only a pattern matrix is returned.

...

Additional arguments to the call, or arguments with changed values.

evaluate

If TRUE, evaluate the new call; otherwise, return the new call.

change.syntax

lavaan model.syntax specifying labels or fixed/free values of parameters in object. These provide some flexibility to customize existing parameters without having to copy/paste the output of as.character(object) into an R script. For example, group.partial will free a parameter across all groups, but update allows users to free the parameter in just one group while maintaining equality constraints among other groups.

Value

summary

signature(object = "measEq.syntax", verbose = TRUE): A character matrix indicating the pattern of numeric, ordered, or latent indicators loading on common factors. By default (verbose = TRUE), summary also prints descriptive details about the model, including the numbers of indicators and factors, and which parameters are constrained to equality.

show

signature(object = "measEq.syntax"): Prints a message about how to use the object for model fitting. Invisibly returns the object.

update

signature(object = "measEq.syntax"), ..., evaluate = TRUE, change.syntax = NULL: Creates a new object with updated arguments in ..., or updated parameter labels or fixed/free specifications in object.

as.character

signature(x = "measEq.syntax", package = "lavaan"): Converts the measEq.syntax object to model syntax that can be copy/pasted or written to a syntax file to be edited before analysis, or simply passed to lavaan to fit the model to data. Generated Mplus syntax could also be utilized using the MplusAuthomation package.

Slots

package

character indicating the software package used to represent the model. Currently, only "lavaan" is available, which uses the LISREL representation (see lavOptions). In the future, "OpenMx" may become available, using RAM representation.

model.type

character. Currently, only "cfa" is available. Future versions may allow for MIMIC / RFA models, where invariance can be tested across levels of exogenous variables explicitly included as predictors of indicators, controlling for their effects on (or correlation with) the common factors.

call

The function call as returned by match.call(), with some arguments updated if necessary for logical consistency.

meanstructure

logical indicating whether a mean structure is included in the model.

numeric

character vector naming numeric manifest indicators.

ordered

character vector naming ordered indicators.

parameterization

character. See lavOptions.

specify

list of parameter matrices, similar in form to the output of lavInspect(fit, "free"). These matrices are logical, indicating whether each parameter should be specified in the model syntax.

values

list of parameter matrices, similar in form to the output of lavInspect(fit, "free"). These matrices are numeric, indicating whether each parameter should be freely estimated (indicated by NA) or fixed to a particular value.

labels

list of parameter matrices, similar in form to the output of lavInspect(fit, "free"). These matrices contain character labels used to constrain parameters to equality.

constraints

character vector containing additional equality constraints used to identify the model when ID.fac = "fx".

ngroups

integer indicating the number of groups.

Examples

Run this code
# NOT RUN {
## See ?measEq.syntax help page for examples using lavaan


# }

Run the code above in your browser using DataLab