Learn R Programming

circumplex (version 2.0.1)

ssm_sem_parameters: Calculate latent SSM parameters from a fitted lavaan measurement model

Description

The 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.

Usage

ssm_sem_parameters(
  fit,
  scales,
  angles = octants(),
  measures = NULL,
  ci_method = c("mvn", "boot"),
  boots = 2000,
  interval = 0.95,
  contrast = FALSE,
  parallel = "no",
  ncpus = 1
)

Value

A circumplex_ssm_sem object; see ssm_sem().

Arguments

fit

Required. A fitted lavaan object whose model preserves the ssm_sem_syntax() parameter structure (factors g, cx, cy; the measures covarying with them). For ci_method = "mvn", fit the model with robust (sandwich) standard errors (lavaan's se = "robust.huber.white", ssm_sem()'s default) so the propagated covariance stays valid when the fixed-angle model is an approximation; see the se argument of ssm_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; NULL on 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 unless group.label was supplied at fitting time -- so read the direction from the output's Group column, not from factor-level conventions.

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.

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.

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

Run this code
if (FALSE) { # requireNamespace("lavaan", quietly = TRUE)
# \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)
# }
}

Run the code above in your browser using DataLab