
Calculate latent SSM parameters from a fitted lavaan measurement model
Source:R/ssm_sem.R
ssm_sem_parameters.RdThe low-level adapter behind ssm_sem(): take an already fitted
lavaan model of a fixed-angle circumplex measurement structure (as
generated by ssm_sem_syntax(), possibly user-modified – e.g., a
partial-invariance respecification) and compute latent SSM parameter
estimates with in-package confidence intervals. Compatibility with the
expected parameter structure is checked structurally (the named loading,
factor-covariance, and measure-covariance parameters must be present), not
by provenance.
Arguments
- fit
Required. A fitted lavaan object whose model preserves the
ssm_sem_syntax()parameter structure (factorsg,cx,cy; the measures covarying with them). Forci_method = "mvn", fit the model with robust (sandwich) standard errors (lavaan'sse = "robust.huber.white",ssm_sem()'s default) so the propagated covariance stays valid when the fixed-angle model is an approximation; see theseargument ofssm_sem().- scales
Required. A character vector with the scale (indicator) names, in the same order as
angles.- angles
Optional. A numeric vector of the scales' theoretical angles in degrees (default =
octants()). Must be the angles the model was generated with.- measures
Optional for multi-group fits, required otherwise. A character vector of the measure names;
NULLon a multi-group fit selects the latent MEAN path (the fit must carry the mean structure: scale intercepts and latent means).- ci_method, boots, interval, contrast, parallel, ncpus
See
ssm_sem(). Note that for a multi-group fit the CONTRAST DIRECTION (and the group labels in the output) follows the fit's own group order – lavaan's default is order of appearance in the data unlessgroup.labelwas supplied at fitting time – so read the direction from the output'sGroupcolumn, not from factor-level conventions.
Value
A circumplex_ssm_sem object; see ssm_sem().
Details
Important: multi-group fits are supported here as the partial-invariance
escape hatch, and this path bypasses the invariance gating that
ssm_sem() applies. Where ssm_sem() fits a configural-metric-scalar
ladder and refuses a latent group contrast when the required rung is
rejected, ssm_sem_parameters() computes the contrast from whatever
multi-group fit you supply without testing invariance at all. You own the
comparability claim: the groups are compared on this instrument's latent
metric only to the extent the model you fitted makes them comparable.
Reproducibility
This function consumes R's random number stream for both ci_method
settings ("mvn" through the package's own draws; "boot" through a
seed handed to lavaan's bootstrap). Call set.seed() immediately before
ssm_sem() for reproducible confidence intervals.
See also
Other ssm functions:
plot.circumplex_ci_accuracy(),
ssm_analyze(),
ssm_analyze_long(),
ssm_ci_accuracy(),
ssm_draws(),
ssm_parameters(),
ssm_parameters_id(),
ssm_score(),
ssm_sem(),
ssm_table(),
summary.circumplex_ssm_id()
Other analysis functions:
cpm_fit(),
cpm_simulate(),
ssm_analyze(),
ssm_analyze_long(),
ssm_ci_accuracy(),
ssm_draws(),
ssm_parameters(),
ssm_parameters_id(),
ssm_score(),
ssm_sem(),
summary.circumplex_ssm_id()
Examples
# \donttest{
data("jz2017")
scales <- c("PA", "BC", "DE", "FG", "HI", "JK", "LM", "NO")
syn <- ssm_sem_syntax(scales = scales, angles = octants(), measures = "NARPD")
# Robust (sandwich) SEs so the mvn engine propagates a
# misspecification-consistent covariance (ssm_sem()'s default)
fit <- lavaan::cfa(syn, data = jz2017, se = "robust.huber.white")
set.seed(12345)
ssm_sem_parameters(fit, scales = scales, measures = "NARPD", boots = 500)
#>
#> # Latent (SEM-based) SSM
#>
#> Measurement model: scaled fixed-angle circumplex
#> Global fit (N = 1166): chisq(17) = 356.099, p < 0.001
#> CFI = 0.93, RMSEA = 0.131, SRMR = 0.072
#>
#> # Profile [NARPD]:
#>
#> Estimate Lower CI Upper CI
#> Elevation 0.249 0.210 0.295
#> X-Value -0.009 -0.054 0.033
#> Y-Value 0.231 0.189 0.273
#> Amplitude 0.232 0.192 0.274
#> Displacement 92.132 82.515 104.461
#> Model Fit 0.975
#>
# }