################################# ### Response Time Analysis ################################# #' # 1. Load Packages, Data and Descriptive Analyses # install.packages("dplyr") # install.packages("ggplot2") # install.packages("RRreg") # install.packages("reshape2") # install.packages("runjags") library(dplyr) library(ggplot2) library(RRreg) library(reshape2) library(runjags) # load data trustgame <- read.csv2("data_trust-game_DQ_RRT_final.csv") #' # 2. Response Time Analysis #' #' ## 2.1. Descriptive Analysis: Completion times for the trust game # People take longer in RRT condition as expected: ggplot(trustgame, aes(x=TIME004/60, fill=Condition.f))+ ggtitle("All Completion Times (Only Trust Question)")+ xlim(0,10)+ geom_density(alpha=.5)+ theme_bw()+xlab("Time [minutes]") # analyses of response times: rt.summ <- trustgame %>% group_by(Condition.f) %>% summarize(Mean_RT=mean(TIME004/60), SD_RT=sd(TIME004/60)) rt.summ #' ## 2.2. Test whether participants were significantly slower in the RRT condition #' #' * Bayesian t- tests #' * Classical t-tests #' * Effect sizes d library(BayesFactor) # DQ(incentivized) vs. RRT ttestBF(x = log(trustgame$TIME004[trustgame$condition == 1]), y = log(trustgame$TIME004[trustgame$condition == 3])) t.test(log(TIME004) ~ Condition.f, data=trustgame, subset = trustgame$condition != 2) diff(rt.summ[2:3,]$Mean_RT)/mean(rt.summ[2:3,]$SD_RT) # DQ(hypothetical) vs. RRT ttestBF(x = log(trustgame$TIME004[trustgame$condition == 1]), y = log(trustgame$TIME004[trustgame$condition == 2])) t.test(log(TIME004) ~ Condition.f, data=trustgame, subset = trustgame$condition != 3) diff(rt.summ[c(1,3),]$Mean_RT)/mean(rt.summ[c(1,3),]$SD_RT) # DQ(hypothetical) vs. DQ(incentivized) ttestBF(x = log(trustgame$TIME004[trustgame$condition == 2]), y = log(trustgame$TIME004[trustgame$condition == 3])) t.test(log(TIME004) ~ Condition.f, data=trustgame, subset = trustgame$condition != 1) diff(rt.summ[1:2,]$Mean_RT)/mean(rt.summ[1:2,]$SD_RT)