Learn R Programming

lavaan (version 0.5-21)

lav_constraints: Utility Functions: Constraints

Description

Utility functions for equality and inequality constraints.

Usage

lav_constraints_parse(partable = NULL, constraints = NULL, theta = NULL, debug = FALSE)

Arguments

partable
A lavaan parameter table.
constraints
A character string containing the constraints.
theta
A numeric vector. Optional vector with values for the model parameters in the parameter table.
debug
Logical. If TRUE, show debugging information.

Details

This is a collection of lower-level constraint related functions that are used in the lavaan code. They are made public per request of package developers. Below is a brief description of what they do:

The lav_constraints_parse function parses the constraints specification (provided as a string, see examples), and generates a list with useful information about the constraints.

Examples

Run this code
myModel <- 'x1 ~ a*x2 + b*x3 + c*x4'
myParTable <- lavaanify(myModel, as.data.frame. = FALSE)
con <- ' a == 2*b
         b - c == 5 '
conInfo <- lav_constraints_parse(myParTable, constraints = con)

Run the code above in your browser using DataLab