semrulesid

semrulesid allows the user to check a structural equation model (SEM) written in lavaan (Rosseel, 2012) syntax, or supplied as a lavaan parameter table or fit object, against a number of identification rules from the literature. Rules are specified as being necessary and/or sufficient and specific reasons are given when a rule is not satisfied or not applicable.

Users should not treat the package output as the sole determinant of model identification. Instead, semrulesid should be used as a “quick check” for potential identification issues and outstanding model specification concerns.

Installation

You can install semrulesid from CRAN:

install.packages("semrulesid")

You can install the development version from GitHub with:

install.packages("pak")
pak::pak("zacharyvig/semrulesid")

Functions

Example: id(my_model, print_msgs = TRUE, lav_fun = "sem")

Example: scaling(my_model, print_msgs = TRUE, lav_fun = "cfa")

Example: id2(my_model, print_msgs = TRUE, lav_fun = "sem")

Example: id(my_model) |> scaling() or scaling(my_model) |> id()

Example

library(semrulesid)

my_model <- '
  L1 =~ x1 + x2 + x3
  L2 =~ x4 + x5 + x6
  L3 =~ x7 + x8 + x9
  L2 ~ L1
  L3 ~ L2
'

id(my_model, meanstructure = FALSE)      # Check identification rules
id2(my_model, meanstructure = FALSE)     # Check the two-step rule
scaling(my_model, meanstructure = FALSE) # Check latent-variable scaling