tef_change_power4: Construct a 4-parameter power function of change

View source: R/tef_change_power4.R

tef_change_power4R Documentation

Construct a 4-parameter power function of change

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_power4(
  timeVar,
  parForm = ~1,
  startForm = ~1,
  rateForm = ~1,
  asymForm = ~1,
  prevTimeForm = ~1,
  rateBase = 2,
  propRemain = 0.25
)

Arguments

timeVar

String. The name of the variable in the model that corresponds to time. The variable of time should be positive and numeric, and the function of change should be expected to happen with increasing time.

parForm

The right-hand side of the formula defining all nonlinear parameters as well as the null [non-time-varying] model.

startForm

The right-hand side of the formula defining the start parameter. Overwrites parForm for this parameter.

rateForm

The right-hand side of the formula defining the rate parameter. Overwrites parForm for this parameter.

asymForm

The right-hand side of the formula defining the asymptote parameter. Overwrites parForm for this parameter.

prevTimeForm

The right-hand side of the formula defining the log of the "previous time" parameter. Overwrites parForm for this parameter. The base of the log is rateBase.

rateBase

Number. The base of the log (e.g., 2 or exp(1)) of the rate [time constant].

propRemain

Change rate is parameterized in terms of the rateBase log of time to this proportion of change remaining (i.e., 1-propRemain of total change occurs in rateBase^rateParameter time.

Details

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_power4('timeVar',parForm = ~ xvar1*xvar2) # both variables should be numeric for TEfit methods! TEbrm should work with factors as well

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