ddm_dr_lm | R Documentation |
Essentially fits a generalized linear model for a Wiener process, using the density
estimation function from the RWiener
package. First fits a standard 4-parameter Wiener
model to the entire RT+response-category vector. Then uses the boundary separation, bias, and
non-decision time from this overall model, and finds the best set of parameters to create a
drift rate vector as a linear function of the right-hand side of formIn
. Only
numeric predictors have been tested.
ddm_dr_lm(formIn, data, respVar, nBoots = 2, fixBias = NA)
formIn |
formula. Left hand side should be response time. |
data |
data |
respVar |
name of the "boundary" column (argument is character; data must be binary 0 and 1) |
nBoots |
number of bootstrapped samples for CI of drift rate parameters. Must be an integer >1 |
fixBias |
Optional scalar value to fix the bias [beta] parameter of the Wiener function |
Note that, for parameters other than drift rate, the RWiener
labeling conventions are used:
alpha
is boundary separation, tau
is non-decision time, and
beta
is bias.
rt ~ 1
will cause an error; in principle, if a unconditional point estimate of drift rate is desired,
a dummy constant numeric variable (e.g., all 0s) could be included as a predictor.
wdm
for the method upon which this is based;
brm
with family "wiener" for a much better (but slower) option.
d <- data.frame(rt = .2 + exp(rnorm(50,-.5,.5))
,corr = rbinom(50,1,.5)
,totalTrialNum = 1:50
)
d$stimStr <- d$rt+rnorm(50,d$corr)
m <- ddm_dr_lm(rt ~ totalTrialNum * stimStr, data = d,respVar='corr',nBoots = 30)
m$model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.