Skip to contents

One solve of the generalized drift-diffusion likelihood serves every trial that shares a parameter vector, and the family finds those trials through an index it is given rather than by comparing parameter values, which it cannot do on a tape. This builds the index: the distinct combinations of the variables you name, numbered.

Usage

gddm_conditions(data, ...)

Arguments

data

A data frame.

...

Bare variable names, or a one-sided formula naming them.

Value

An integer vector, one entry per row of data.

Details

Name every variable that appears on the right-hand side of any formula in the model, and every covariate a drift term reads. Naming more than that is safe and only costs solves. Naming fewer is refused by gddm(), which compares each parameter's design against its condition's first row and says which variable is missing from the index.

See also

Examples

d <- data.frame(coh = c(0, 0, 0.5, 0.5), block = c(1, 2, 1, 2))
gddm_conditions(d, coh, block)
#> [1] 1 2 3 4
gddm_conditions(d, ~ coh)
#> [1] 1 1 2 2