View source: R/graphical_var_each.R
| fit_graphical_var_each | R Documentation |
Applies fit_graphical_var() to each subject separately, returning one
person-specific network per individual — the idiographic "all individuals"
workflow. Subjects that cannot be fit (too few lag pairs after listwise
deletion) are dropped with a warning.
fit_graphical_var_each(
data,
vars,
id,
day = NULL,
beep = NULL,
min_obs = NULL,
...
)
data |
A data.frame or matrix with columns for variables, and optionally
id, day, beep columns for panel/ESM data. A prepared list containing
numeric matrices |
vars |
Character vector of variable names. May be omitted for prepared
input when |
id |
Character. The subject-id column (required here). |
day |
Character. Name of the day/session column. Default: NULL. |
beep |
Character. Name of the beep/measurement column. Default: NULL. |
min_obs |
Integer or |
... |
Further arguments passed to |
A named list of gvar_result objects (class gvar_list), one element
per subject, named by subject id.
set.seed(2)
d <- data.frame(id = rep(1:2, each = 35),
A = rnorm(70), B = rnorm(70))
fits <- fit_graphical_var_each(d, vars = c("A", "B"), id = "id",
n_lambda = 3, scale = FALSE)
names(fits)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.