This function constructs a structural latent class model (SLCM) for specified latent class variables.
Arguments
- formula
a formula specifying the latent structure. Detailed model specification is provided under 'Details'.
- ...
additional formulae for defining the model structure.
- constraints
a list of constraints for maintaining measurement invariance. Detailed explanation of applying constraints is available under 'Details'.
Value
An object of class slca
containing various components of the model:
tree
: Adata.frame
that details the parent-child relationships among latent class and manifest variables.latent
: Adata.frame
listing all latent class variables with details on each.measure
: Adata.frame
that describes the measurement model.struct
: Adata.frame
that details the structural model.
The object prints model description with four part.
Latent variables: lists the latent class variables incorporated in the model, along with the number of classes for each variable. The root variable is marked by asterisk (
*
).Measurement model: Shows manifest indicators for each latent class variable and indicates measurement constraints (lowercase letters signify consistency).
Structural model: Describes conditional dependencies between latent class variables.
Dependency constraints: Outlines the constraints applied to the conditional dependencies between latent class variables. Each column marked with an uppercase alphabet symbolizes a consistent dependency structure.
Details
The formula
can be broadly categorized into three main types, each serving a distinct purpose:
Defining Latent Class Variables with Manifest Indicators: Specify the relationship between a latent class variable and its manifest indicators. For example:
Defining Latent Class Variables with Manifest Indicators: Specify the relationship between a latent class variable and its manifest indicators. In these formulas, the latent class variable, denoted with square brackets or parentheses indicating the number of classes, is on the left-hand-side (lhs) and its manifest indicators are specified on right-hand-side (rhs). For example,
LC1[k] ~ x1 + x2 + x3 LC2[k] ~ y1 + y2 + y3 LC3(k) ~ z1 + z2 + z3
In these formulas,
k
denotes the number of latent classes for the variable.Relating Latent Class Variables to Each Other: Define relationships where one latent class variable is influenced by another. The subsequent example implies that
LC2
is conditionally affected based onLC1
.LC1 ~ LC2
Defining higher-level latent class variable: Identify latent class variables by other latent class variables rather than manifest indicators. Following example suggests that the
P
is measured byLC1
,LC2
, andLC3
– all of which are latent class variables.P[k] ~ LC1 + LC2 + LC3
In all types of the formula, variables specified on the left-hand side (lhs) influence those on the right-hand side (rhs).
The constraints
parameter allows you to enforce specific conditions on the model to ensure precise inference. For instance, in Longitudinal Latent Class Analysis (LTA), it's imperative that latent class variables across various time-points convey identical meanings. With the constraints
option, users can uphold measurement invariance in both the measurement and structural components of the model.
Measurement Invariance for Measurement Model: Ensures that probabilities associated with latent class variables are consistent, thus maintaining semantic meaning across classes.
c("LC1", "LC2", "LC3")
This command ensures that variables
LC1
,LC2
, andLC3
are semantically consistent.Measurement invariance for structural model: Applies constraints within the structural model to ensure consistent interpretations of transition probabilities.
c("P ~ LC1", "P -> LC2")
This command implies that the transition probabilities from
P
toLC1
and fromP
toLC2
are consistent.
Examples
# Standard LCA
slca(lc[3] ~ y1 + y2 + y3)
#> Structural Latent Variable Model
#>
#> Latent variables (Root*):
#> Label: lc*
#> nclass: 3
#>
#> Measurement model:
#> lc -> { y1, y2, y3 } a
# Latent transition analysis (LTA)
slca(l1[3] ~ y11 + y21 + y31,
l2[3] ~ y12 + y22 + y32,
l1 ~ l2)
#> Structural Latent Variable Model
#>
#> Latent variables (Root*):
#> Label: l1* l2
#> nclass: 3 3
#>
#> Measurement model:
#> l1 -> { y11, y21, y31 } a
#> l2 -> { y12, y22, y32 } b
#>
#> Structural model:
#> l1 -> { l2 }
#>
#> Dependency constraints:
#> A
#> l1 -> l2
# LTA with measurement invariance
slca(l1[3] ~ y11 + y21 + y31,
l2[3] ~ y12 + y22 + y32,
l1 ~ l2, constraints = c("l1", "l2"))
#> Structural Latent Variable Model
#>
#> Latent variables (Root*):
#> Label: l1* l2
#> nclass: 3 3
#>
#> Measurement model:
#> l1 -> { y11, y21, y31 } a
#> l2 -> { y12, y22, y32 } a
#>
#> Structural model:
#> l1 -> { l2 }
#>
#> Dependency constraints:
#> A
#> l1 -> l2
# Joint latent class analysis
slca(lx[3] ~ x1 + x2 + x3, ly[3] ~ y1 + y2 + y3,
lz[3] ~ z1 + z2 + z3, jc[3] ~ lx + ly + lz)
#> Structural Latent Variable Model
#>
#> Latent variables (Root*):
#> Label: lx ly lz jc*
#> nclass: 3 3 3 3
#>
#> Measurement model:
#> lx -> { x1, x2, x3 } a
#> ly -> { y1, y2, y3 } b
#> lz -> { z1, z2, z3 } c
#>
#> Structural model:
#> jc -> { lx, ly, lz }
#>
#> Dependency constraints:
#> A B C
#> jc -> lx jc -> ly jc -> lz
# Latent class profile analysis (with measurement invariance)
slca(l1[3] ~ x1 + x2 + x3, l2[3] ~ y1 + y2 + y3,
l3[3] ~ z1 + z2 + z3, pf[3] ~ lx + ly + lz,
constraints = c("l1", "l2", "l3"))
#> Structural Latent Variable Model
#>
#> Latent variables (Root*):
#> Label: l1* l2* l3* pf*
#> nclass: 3 3 3 3
#>
#> Measurement model:
#> l1 -> { x1, x2, x3 } a
#> l2 -> { y1, y2, y3 } a
#> l3 -> { z1, z2, z3 } a
#> pf -> { lx, ly, lz } b