tef_change_gam: Construct a by-time Generalized Additive Model formula

View source: R/tef_change_gam.R

tef_change_gamR Documentation

Construct a by-time Generalized Additive Model formula

Description

By defining the model variable associated with time (e.g., trial number), and formulas defining each of the nonlinear parameters of time-related change, this function constructs a model that can then be passed to functions for fitting the model (e.g., TEbrm).

Usage

tef_change_gam(
  timeVar,
  timeCovar = c(NULL),
  groupingVar = "",
  bs = c("ts", "cr", "cs", "tp", "cc")
)

Arguments

timeVar

String. Indicates the name of the time variable

timeCovar

Vector of strings, for variables that will be included in the time-evolving model.

groupingVar

String. Optional grouping variable (e.g., participant ID, in a behavioral study). If this is non-empty, then all timeCovar are fit on the level of groupingVar

bs

Two letter character string inidicating the basis for smoothing. See ?mgcv::s

Details

Use is primarily for passing to link functions. If no link function is needed, then an equivalent formula can be passed directly to brm.

Function is under development and is likely to be buggy, and to change frequently.

See Also

TEbrm for examples of how to use this function in specifying models.

Examples

equation_to_fit <- tef_change_gam('trialNum')



akcochrane/TEfits documentation built on June 12, 2025, 11:10 a.m.