A body detection inversion effect revealed by a large-scale inattentional blindness experiment. Cognition (2025)
This R function will take a vector X which correspond to your DV of interest. Y corresponds to the no. of SDs above or below we want to use. We assume that X is a vector from a matrix that represent the mean value per subject across conditions.
#Compute matrix per subject across condition using dplyr:SubjMeans <- RawData %>% group_by(SubjID) %>% #group data by the subj variable summarise(aveRT = mean(RT[Acc==1]), avecorr = mean(Acc)) #compute mean RT accurate trials and mean accuracy#define Outliers functionOut_Classifier <- function(x,y) { performance <-rep(NA, length(x)) #Performance empty vector for (i in 1:length(x)) { if(x[i] > mean(x)+(sd(x)*y)){ performance[i] <- "slow" } else if (x[i] < mean(x)-(sd(x)*y)){ performance[i] <- "Inaccurate/fast" } else {performance[i] <- "OK" } } print(performance)}#Apply functions to your variablesOut_Classifier(SubjMeans$aveRT) #will return a vector with a string depending on the performance of each subj.Out_Classifier(SubjMeans$Acc)