Loads subject PEBs (.rds or .mat), builds the third-level design, runs the PEB-of-PEBs, and returns a tidy summary. Optionally saves the group PEB.

dcm_peb_of_pebs(
  peb_dir,
  subjects = NULL,
  covariates = NULL,
  Xnames = NULL,
  save_path = NULL,
  M = list(Q = "single", alpha = 1, beta = 16, maxit = 64),
  field = "all",
  verbose = TRUE
)

Arguments

peb_dir

Directory containing the subject PEB files.

subjects

Optional integer vector; restrict to these subject numbers.

covariates

Optional data frame of between-subject covariates, one row per subject in the order returned by dcm_peb_files. NULL gives an intercept-only design (the group mean).

Xnames

Optional custom design column names.

save_path

Optional path to save the group PEB to, as .rds. NULL (the default) does not write anything to disk.

M

Third-level model options passed to dcm_peb_prepare.

field

Parameter blocks to model; "all" is typical for PEB inputs.

verbose

Logical. Report progress via message().

Value

List with group_PEB, save_path (NULL if not saved), subjects, X (the design), and summary (a tidy data frame of parameter estimates).

Details

Nothing is written to disk unless save_path is supplied.