rm(list=ls(all=TRUE)) # clear all variables graphics.off() # clear all graphics # Sternberg Search # Greg Francis # PSY 626 # March 27, 2024 # load full data file SSdata<-read.csv(file="SternbergSearch.csv",header=TRUE,stringsAsFactors=FALSE) # Treat MemorySetSize as a factor SSdata$MemorySetSize = factor(SSdata$MemorySetSize) levels(SSdata$MemorySetSize) = c("Small", "Medium", "Large") # Treat Condition as a factor SSdata$Condition = factor(SSdata$Condition) # Treat Participants as a factor SSdata$Participant = factor(SSdata$Participant) # NHST ANOVA NHST <- aov(RT ~ Condition*MemorySetSize + Error(Participant/(Condition*MemorySetSize)), data=SSdata) print(summary(NHST)) flush.console() # load the BayesFactor library library(BayesFactor) # run the default BayesFactor ANOVA bf = anovaBF(RT ~ Condition*MemorySetSize + Participant, data=SSdata, whichRandom="Participant") summary(bf) flush.console() # With more sampling iterations (default is 10000) newbf = recompute(bf, iterations = 500000) summary(newbf) flush.console() # run all possible models bf2 = anovaBF(RT ~ Condition*MemorySetSize + Participant, whichRandom="Participant", data=SSdata, whichModels="all", iterations=500000) summary(bf2) flush.console()