Build a GAM formula dynamically
Usage
build_formula(
target,
covariates,
smooth_terms = NULL,
group_by = "group",
participant_id = "subjectID",
k
)
Arguments
- target
Diffusion metric to model
- covariates
List of strings of GAM covariates, not including the smoothing terms over nodes and the random effect due to subjectID. This list can also include smoothing terms.
- smooth_terms
Smoothing terms, not including the smoothing terms over nodes and the random effect due to subjectID.
- group_by
The grouping variable used to group nodeID smoothing terms
- participant_id
The name of the column that encodes participant ID
- k
Dimension of the basis used to represent the node smoothing term