| fit_gimme | R Documentation |
Estimates person-specific directed networks from intensive longitudinal data using the unified Structural Equation Modeling (uSEM) framework. Implements a data-driven search that identifies:
Group-level paths: Directed edges present for a majority (default 75\
Individual-level paths: Additional edges specific to each person, found after group paths are established.
Uses lavaan for SEM estimation and modification indices.
Accepts a single data frame with an ID column (not CSV directories).
fit_gimme(
data,
vars,
id,
time = NULL,
day = NULL,
beep = NULL,
min_obs = NULL,
subject = NULL,
ar = TRUE,
standardize = FALSE,
groupcutoff = 0.75,
subcutoff = 0.75,
paths = NULL,
exogenous = NULL,
hybrid = FALSE,
VAR = FALSE,
rmsea_cutoff = 0.05,
srmr_cutoff = 0.05,
nnfi_cutoff = 0.95,
cfi_cutoff = 0.95,
n_excellent = 2L,
seed = NULL,
group_correct = "Bonferroni Group",
indiv_correct = "Bonferroni",
alpha = 0.05,
stop_crit = "model fit",
subgroup = FALSE,
outcome = NULL,
conv_vars = NULL,
mult_vars = NULL,
lv_model = NULL,
lasso_model_crit = NULL,
ms_allow = FALSE,
ordered = NULL,
dir_prop_cutoff = 0,
out = NULL,
sep = NULL,
header = NULL,
plot = FALSE,
sub_feature = "lag & contemp",
sub_method = "Walktrap",
sub_sim_thresh = "lowest",
confirm_subgroup = NULL,
conv_length = 16,
conv_interval = 1,
mean_center_mult = FALSE,
diagnos = FALSE,
ms_tol = 1e-05,
lv_estimator = "miiv",
lv_scores = "regression",
lv_miiv_scaling = "first.indicator",
lv_final_estimator = "miiv"
)
data |
A |
vars |
Character vector of variable names to model. |
id |
Character string naming the person-ID column. |
time |
Character string naming the time/order 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 exact subject(s) to analyse. |
ar |
Logical. If |
standardize |
Logical. If |
groupcutoff |
Numeric between 0 and 1. Proportion of individuals for
whom a path must be significant to be added at group level.
Default |
subcutoff |
Numeric. Subgroup cutoff (default 0.75, matching
|
paths |
Character vector of lavaan-syntax paths to force into the model
(e.g., |
exogenous |
Character vector of variable names to treat as exogenous.
Default |
hybrid |
Logical. If |
VAR |
Logical. If |
rmsea_cutoff |
Numeric. RMSEA threshold for excellent fit (default 0.05). |
srmr_cutoff |
Numeric. SRMR threshold for excellent fit (default 0.05). |
nnfi_cutoff |
Numeric. NNFI/TLI threshold for excellent fit (default 0.95). |
cfi_cutoff |
Numeric. CFI threshold for excellent fit (default 0.95). |
n_excellent |
Integer. Number of fit indices that must be excellent to
stop individual search. Default |
seed |
Integer or |
group_correct |
Group-level multiple-comparison correction. Use
|
indiv_correct |
Individual-level multiple-comparison correction. Use
|
alpha |
Base significance level for group and individual searches.
Default |
stop_crit |
Individual-search stopping rule. |
subgroup |
Logical. Subgrouping (S-GIMME) is not implemented; |
outcome, conv_vars, mult_vars, lv_model, lasso_model_crit, ms_allow, ordered, dir_prop_cutoff |
Accepted for |
out, sep, header, plot |
Accepted for |
sub_feature, sub_method, sub_sim_thresh, confirm_subgroup, conv_length, conv_interval, mean_center_mult, diagnos, ms_tol, lv_estimator, lv_scores, lv_miiv_scaling, lv_final_estimator |
Accepted for |
An S3 object of class "net_gimme" containing:
temporalp x p matrix of group-level temporal (lagged)
path counts – entry [i,j] = number of individuals with path j(t-1)->i(t).
contemporaneousp x p matrix of group-level contemporaneous
path counts – entry [i,j] = number of individuals with path j(t)->i(t).
coefsList of per-person q x (q + p) coefficient matrices
(q non-exogenous rows; columns = [lagged, contemporaneous]).
psiList of per-person q x (q + p) standardized
residual covariance matrices, with non-exogenous current variables in
rows and
c(lag_names, varnames) in columns, matching gimme::gimme()'s
returned psi contract.
fitData frame of per-person fit indices (chisq, df, pvalue, rmsea, srmr, nnfi, cfi, bic, aic, logl, status).
path_countsp x 2p matrix: how many individuals have each path.
pathsList of per-person character vectors of lavaan path syntax.
group_pathsCharacter vector of group-level paths found.
individual_pathsList of per-person character vectors of individual-level paths (beyond group).
syntaxList of per-person full lavaan syntax strings.
labelsCharacter vector of variable names.
n_subjectsInteger. Number of individuals.
n_obsInteger vector. Time points per individual.
configList of configuration parameters.
fit_mlvar, fit_graphical_var,
as_netobject
# Create simple panel data (3 subjects, 4 variables, 50 time points).
set.seed(42)
n_sub <- 3; n_t <- 50; vars <- paste0("V", 1:4)
rows <- lapply(seq_len(n_sub), function(i) {
d <- as.data.frame(matrix(rnorm(n_t * 4), ncol = 4))
names(d) <- vars; d$id <- i; d
})
panel <- do.call(rbind, rows)
res <- fit_gimme(panel, vars = vars, id = "id")
print(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.