#=========================================================# # FLANKER RELIABILITY ESTIMATE #=========================================================# #----------- # LIBS #----------- library(plyr) source("C://Dropbox//PHD_MultisensoryNeglect//BasicFunctions.R") #----------- # DATA #----------- dp <- "C://Dropbox//EFT_Project//Internship_EFT_HH//CO 12//Data 1.0//FLANKER//" FLANK <- ReadTextFile(dp, sep = "\t") #----------- # OUTLIERS #----------- participants <- ddply(FLANK, c("participant"), function(df)c(Acc = mean(df$Acc[df$Congruency != "incongruent"]))) FLANK <- FLANK[FLANK$participant %in% participants$participant[participants$Acc > (mean(participants$Acc) - 2.5 * sd(participants$Acc))], ] length(unique(FLANK$participant)) remove(participants) #---------------------------------- # CALCULATE DV FOR SEPERATE HALVES #---------------------------------- FLANK$TrialNumber <- rep(seq(1,120,1), 130) # Summarize: RT_Summary <- ddply(FLANK, c("participant"), function(df)c(RTIncongr1 = mean(df$RT[df$Acc == 1 & df$Congruency == "congruent" & df$TrialNumber <= 60]), RTIncongr2 = mean(df$RT[df$Acc == 1 & df$Congruency == "congruent" & df$TrialNumber > 60]), RTCongr1 = mean(df$RT[df$Acc == 1 & df$Congruency == "incongruent" & df$TrialNumber <= 60]), RTCongr2 = mean(df$RT[df$Acc == 1 & df$Congruency == "incongruent" & df$TrialNumber > 60]), RTBase1 = mean(df$RT[df$Acc == 1 & df$Congruency == "neutral" & df$TrialNumber <= 60]), RTBase2 = mean(df$RT[df$Acc == 1 & df$Congruency == "neutral" & df$TrialNumber > 60]))) RT_Summary$FlankEffect1 <- (RT_Summary$RTIncongr1/RT_Summary$RTBase1) - (RT_Summary$RTCongr1/RT_Summary$RTBase1) RT_Summary$FlankEffect2 <- (RT_Summary$RTIncongr2/RT_Summary$RTBase2) - (RT_Summary$RTCongr2/RT_Summary$RTBase2) #---------------------------------- # RELIABILITY #---------------------------------- plot(RT_Summary$FlankEffect1, RT_Summary$FlankEffect2) cor.test(RT_Summary$FlankEffect1, RT_Summary$FlankEffect2) spb <- (2 * cor(RT_Summary$FlankEffect1, RT_Summary$FlankEffect2)) / (1 + (2 - 1) * cor(RT_Summary$FlankEffect1, RT_Summary$FlankEffect2))