library(BayesFactor)
library(ez)
Y = matrix(
c(“h”,”h”,”h”,”h”,”h”,”h”,”h”,”v”,”v”,”v”,”v”,”v”,”h”,”h”,”h”,”h”,”h”,”h”,”h”,”h”,
“v”,”v”,”v”,”v”,”v”,”v”,”v”,”v”,”v”,”v”,”v”,”v”,”h”,”h”,”h”,”h”,”h”,”h”,”h”,”h”,
“h”,”h”,”v”,”v”,”v”,”v”,”h”,”h”,”h”,”h”,”h”,”h”,”h”,”v”,”v”,”v”,”v”,”v”,”v”,”v”,
“nSR”,”SR”,”SR”,”SR”,”SR”,”nSR”,”nSR”,”SR”,”nSR”,”SR”,”nSR”,”SR”,”nSR”,”SR”,”nSR”,
“SR”,”nSR”,”SR”,”nSR”,”SR”,”SR”,”SR”,”nSR”,”SR”,”SR”,”SR”,”nSR”,”SR”,”nSR”,”SR”,
“SR”,”SR”,”SR”,”SR”,”SR”,”nSR”,”SR”,”nSR”,”SR”,”nSR”,”nSR”,”SR”,”SR”,”nSR”,”nSR”,
“SR”,”nSR”,”nSR”,”SR”,”nSR”,”nSR”,”nSR”,”SR”,”nSR”,”SR”,”SR”,”nSR”,”nSR”,”SR”,”SR”,
34,13,13,14,15,11,13,15,11,17,11,12,17,13,12,14,8,15,7,18,35,20,28,10,15,12,8,18,15,
17,23,10,7,12,14,18,12,11,6,20,20,9,13,12,15,15,8,7,12,4,12,9,13,17,11,30,19,13,20,8
),
nrow=60,
ncol=3)
data = as.data.frame(Y)
colnames(data) = c(“condition”, “hand”, “recall”)
summary(data)
data$recall = as.numeric(data$recall)
data$partno = 1:nrow(data)

##descriptives
#condition only
tapply(data$recall, list(data$condition), mean)
tapply(data$recall, list(data$condition), sd)
tapply(data$recall, list(data$condition), length)
#hand only
tapply(data$recall, list(data$hand), mean)
tapply(data$recall, list(data$hand), sd)
tapply(data$recall, list(data$hand), length)
#interaction
tapply(data$recall, list(data$condition, data$hand), mean)
tapply(data$recall, list(data$condition, data$hand), sd)
tapply(data$recall, list(data$condition, data$hand), length)

##NHST 2×2 Between-Subjects ANOVA
library(ez)
ezANOVA(data = data,
wid = partno,
between = .(condition, hand),
dv = recall,
type = 3)

##Bayes Factor ANOVA
Model1 = anovaBF(recall~condition*hand,
data = data)
summary(Model1)
plot(Model1)

Advertisements