| fit_usem | R Documentation |
Fits person-specific unified Structural Equation Models (uSEM) for intensive
longitudinal data. A uSEM combines lagged directed effects, optional
contemporaneous directed effects, and optional residual covariances in one
SEM. Unlike fit_gimme(), this function does no automated path search:
the model is fixed by temporal, contemporaneous, residual_cov, and
paths. With trim = TRUE, idiographic uses an independent clean-room
modification-index entry and z-value pruning layer over the declared
candidate set.
fit_usem(
data,
vars,
id,
time = NULL,
day = NULL,
beep = NULL,
min_obs = NULL,
subject = NULL,
temporal = c("ar", "all", "none"),
contemporaneous = c("none", "all"),
residual_cov = TRUE,
trim = FALSE,
trim_alpha = 0.05,
trim_fit_criteria = 3L,
cfi_cutoff = 0.95,
tli_cutoff = 0.95,
rmsea_cutoff = 0.08,
srmr_cutoff = 0.08,
paths = NULL,
exogenous = NULL,
standardize = FALSE,
estimator = "ml",
seed = NULL
)
data |
A |
vars |
Character vector of time-varying variables. |
id |
Character string naming the person-ID column. |
time |
Character string naming the within-person ordering column, or
|
day |
Character string naming the day/session column, or |
beep |
Character string naming the measurement-occasion column, or
|
min_obs |
Integer or |
subject |
Optional vector naming the subject(s) to analyse. |
temporal |
|
contemporaneous |
|
residual_cov |
Logical. Estimate residual covariances among current
endogenous variables? Default |
trim |
Logical. If |
trim_alpha |
Significance level used for modification-index entry and
z-value pruning when |
trim_fit_criteria |
Number of fit criteria that must pass before
forward search stops. Default |
cfi_cutoff, tli_cutoff, rmsea_cutoff, srmr_cutoff |
Fit thresholds used by trimmed uSEM. |
paths |
Extra lavaan syntax lines to include unchanged. |
exogenous |
Optional subset of |
standardize |
Logical. Standardize variables per person before fitting. |
estimator |
Lavaan estimator. Default |
seed |
Optional random seed. |
A net_usem object with average $temporal,
$contemporaneous, and $residual_cov matrices, per-subject matrices in
$subjects, a tidy coefficient table from coefs(), fit indices, syntax,
labels, and configuration metadata.
fit_gimme(), fit_graphical_var(), fit_mlvar()
set.seed(1)
d <- data.frame(
id = rep(1:4, each = 30),
t = rep(seq_len(30), 4),
A = rnorm(120), B = rnorm(120), C = rnorm(120)
)
fit <- fit_usem(d, vars = c("A", "B", "C"), id = "id", time = "t")
edges(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.