library(dplyr) library(ggplot2) library(reshape2)
4 parameter function:
$$ RT = T_{min} + (T_{max}-T_{min})(e^{-\lambda |x|}) $$
Tmin <- .5 Tmax <- 90 lambdas <- c(3,2,1,.75,.5,.25,.1) x <- seq(-10,10,by=.2) y <- sapply(lambdas, function(l) Tmin + (Tmax-Tmin)*exp(-l*abs(x))) %>% melt(value.name="RT") %>% rename(lambda=Var2) %>% mutate(Var1 = rep(x,times= nrow(.)/length(x)), lambda = lambdas[lambda]) %>% rename(x=Var1) lambda_plot <- ggplot(y, aes(x=x,y=RT, color = factor(lambda))) + geom_line(size=.75) + scale_y_continuous(breaks=seq(0,90,by=10)) + scale_color_discrete("Lambda") + scale_x_continuous("Distance to Threshold", breaks=-10:10) + ggtitle("Predicted RT for Different Lambdas") print(lambda_plot)
Reaction times to distances below the threshold represent the time until the participant "gives up" on recalling and moves to a new item.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.