#setwd("~/Documents/PMC_SRTT_Analysis")
require(ggplot2)
Loading required package: ggplot2
require(xlsx)
Loading required package: xlsx
react_data = read.xlsx("2021SRTTMastersheet.xlsx",sheetIndex = 2)
#react_data = read.csv2("2021SRTTMastersheet.xlsx", header = T)
react_data = react_data[react_data$Task.Difficulty == "4-color",]
ss_data = read.xlsx("2021SRTTMastersheet.xlsx", sheetIndex = 3)
ss_data = ss_data[ss_data$Task.Difficulty == "4-color",]
mp_data = read.xlsx("2021SRTTMastersheet.xlsx", sheetIndex = 4)
#Q1: Are/Is PMC/M1 necessary for skill acquisition?
H1a: deltaSS (BLOCKSSpost - BLOCKSSpre)
oneway.test(Change.SS.POST ~ TMS.Group, data = ss_data, var.equal = T)
One-way analysis of means
data: Change.SS.POST and TMS.Group
F = 0.31215, num df = 2, denom df = 26, p-value = 0.7346
Plot
ggplot(ss_data, aes(x=TMS.Group, y=Change.SS.POST, color = TMS.Group)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') +
ylab(expression(paste(Delta,"SSacq"))) + xlab("TMS Groups") +
theme(text = element_text(size = 24))
#+ ylim(-10,10)
H1b: MP (RANDpost - RANDpre)
oneway.test(RandDiff ~ TMS.Group, data = react_data, var.equal = T)
One-way analysis of means
data: RandDiff and TMS.Group
F = 2.6299, num df = 2, denom df = 26, p-value = 0.09116
Plot
react_data = react_data[1:40,]
ggplot(react_data, aes(x=TMS.Group, y=RandDiff, color = TMS.Group)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') +
ylab(expression(paste(Delta,"MPacq"))) + xlab("TMS Groups") + scale_x_discrete(limits=c("Control","M1","PMC")) +
theme(text = element_text(size = 24))
# + ylim(-10,10)
Q2: Task difficulty on skill learning
to reintroduce the 2-color data
ss_data = read.xlsx("2021SRTTMastersheet.xlsx", sheetIndex = 3)
H2a: skill acq. (deltaSS_post-pre)
ss_data = ss_data[ss_data$TMS.Group == "Control",]
t.test(Change.SS.POST ~ Task.Difficulty, data = ss_data)
Welch Two Sample t-test
data: Change.SS.POST by Task.Difficulty
t = 0.86286, df = 14.289, p-value = 0.4025
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-22.73287 53.43287
sample estimates:
mean in group 2-color mean in group 4-color
4.20 -11.15
Plot
ss_data$Task.Difficulty = as.factor(ss_data$Task.Difficulty)
ggplot(ss_data, aes(x=Task.Difficulty, y=Change.SS.POST, color = Task.Difficulty)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') + scale_color_manual(values=c("#999999", "#F8766D")) +
ylab(expression(paste(Delta, "SSacq"))) + xlab("Task Difficulty") +
theme(text = element_text(size = 24))
#+ ylim(-10,10)
H2b: skill ret. (deltaSS_ret-post)
t.test(Change.SS.RET ~ Task.Difficulty, data = ss_data)
Welch Two Sample t-test
data: Change.SS.RET by Task.Difficulty
t = -4.1777, df = 17.957, p-value = 0.0005682
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-30.059632 -9.940368
sample estimates:
mean in group 2-color mean in group 4-color
-8.2 11.8
Plot
ggplot(ss_data, aes(x=Task.Difficulty, y=Change.SS.RET, color = Task.Difficulty)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') + scale_color_manual(values=c("#999999", "#F8766D")) +
ylab(expression(paste(Delta,"SSret"))) + xlab("Task Difficulty") +
theme(text = element_text(size = 24))
H2c: Skill Gen. (deltaSS_gen-ret)
t.test(Change.SS.GEN ~ Task.Difficulty, data = ss_data)
Welch Two Sample t-test
data: Change.SS.GEN by Task.Difficulty
t = 2.9073, df = 13.01, p-value = 0.01223
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
14.75019 100.04981
sample estimates:
mean in group 2-color mean in group 4-color
65.75 8.35
Plot
ggplot(ss_data, aes(x=Task.Difficulty, y=Change.SS.GEN, color = Task.Difficulty)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') + scale_color_manual(values=c("#999999", "#F8766D")) +
ylab(expression(paste(Delta, "SSgen"))) + xlab("Task Difficulty") +
theme(text = element_text(size = 24))
DeltaMPacq
t.test(ΔMPacq ~ Task.Difficulty, data = mp_data)
Welch Two Sample t-test
data: ΔMPacq by Task.Difficulty
t = 2.2394, df = 12.137, p-value = 0.04461
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
1.89192 132.00808
sample estimates:
mean in group 2-color mean in group 4-color
-75.50 -142.45
Plot: DeltaMPacq
ggplot(mp_data, aes(x=Task.Difficulty, y= ΔMPacq, color = Task.Difficulty)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') + scale_color_manual(values=c("#999999", "#F8766D")) +
ylab(expression(paste(Delta, "MPacq"))) + xlab("Task Difficulty") +
theme(text = element_text(size = 24))
DeltaMPacq
t.test(ΔMPret ~ Task.Difficulty, data = mp_data)
Welch Two Sample t-test
data: ΔMPret by Task.Difficulty
t = 0.32761, df = 17.679, p-value = 0.7471
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-29.54551 40.44551
sample estimates:
mean in group 2-color mean in group 4-color
-11.45 -16.90
Plot: DeltaMPret
ggplot(mp_data, aes(x=Task.Difficulty, y= ΔMPret, color = Task.Difficulty)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') + scale_color_manual(values=c("#999999", "#F8766D")) +
ylab(expression(paste(Delta, "MPret"))) + xlab("Task Difficulty") +
theme(text = element_text(size = 24))
Exploratory: Control vs M1 on RandDiff
react_data = read.xlsx("2021SRTTMastersheet.xlsx",sheetIndex = 2)
react_data = react_data[react_data$TMS.Group != "PMC",]
react_data$Task.Difficulty = factor(react_data$Task.Difficulty)
react_data = react_data[react_data$Task.Difficulty == "4-color",]
t.test(RandDiff ~ TMS.Group, data = react_data)
Welch Two Sample t-test
data: RandDiff by TMS.Group
t = -2.4388, df = 12.653, p-value = 0.03029
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-139.545074 -8.254926
sample estimates:
mean in group Control mean in group M1
-142.45 -68.55
Plot: DeltaMPacq
ggplot(react_data, aes(x=TMS.Group, y= RandDiff, color = TMS.Group)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') + scale_color_manual(values=c("#999999", "#F8766D")) +
ylab(expression(paste(Delta, "MPacq"))) + xlab("Task Difficulty") +
theme(text = element_text(size = 24))
2 V 4 RandGen
react_data = read.xlsx("2021SRTTMastersheet.xlsx",sheetIndex = 2)
react_data = react_data[react_data$TMS.Group == "Control",]
t.test(deltaMPgen ~ Task.Difficulty, data = react_data, alternative = "two.sided", na.rm = T)
Welch Two Sample t-test
data: deltaMPgen by Task.Difficulty
t = 6.8003, df = 11.403, p-value = 2.464e-05
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
141.1367 275.3633
sample estimates:
mean in group 2-color mean in group 4-color
191.60 -16.65
Plot: DeltaMPgen
ggplot(react_data, aes(x=Task.Difficulty, y= deltaMPgen, color = Task.Difficulty)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') + scale_color_manual(values=c("#999999", "#F8766D")) +
ylab(expression(paste(Delta, "MPgen"))) + xlab("Task Difficulty") +
theme(text = element_text(size = 24)) + scale_x_discrete(limits=c("2-color","4-color"))
SRTT All conditions: sub 44
srtt = read.xlsx("Response_timeX_Timepoint.xlsx",sheetIndex = 1)
#srtt$sub44 = as.factor(srtt$sub44)
ggplot(data = srtt, aes(x = Timepoint, y = sub44, group = 1)) + geom_line() + geom_point() +
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1)) + ylab("Response Time (ms)") +
scale_x_discrete(limits=c("RandPRE1", "RepPRE", "RandPRE2", "Train1", "Train2", "Train3", "Train4", "Train5", "RandPOST1", "RepPOST", "RandPOST2", "RandRET1", "RepRET", "RandRET2", "RandGEN1", "RepGEN","RandGEN2")) +
theme(text = element_text(size = 22))
SRTT All conditions: sub 39
srtt = read.xlsx("Response_timeX_Timepoint.xlsx",sheetIndex = 1)
ggplot(data = srtt, aes(x = Timepoint, y = sub39, group = 1)) + geom_line() + geom_point() +
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1)) + ylab("Response Time (ms)") + scale_x_discrete(limits=c("RandPRE1", "RepPRE", "RandPRE2", "Train1", "Train2", "Train3", "Train4", "Train5", "RandPOST1", "RepPOST", "RandPOST2", "RandRET1", "RepRET", "RandRET2", "RandGEN1", "RepGEN","RandGEN2")) +
theme(text = element_text(size = 22))
SRTT All conditions: sub 31
srtt = read.xlsx("Response_timeX_Timepoint.xlsx",sheetIndex = 1)
ggplot(data = srtt, aes(x = Timepoint, y = sub31, group = 1)) + geom_line() + geom_point() +
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1)) + ylab("Response Time (ms)") + scale_x_discrete(limits=c("RandPRE1", "RepPRE", "RandPRE2", "Train1", "Train2", "Train3", "Train4", "Train5", "RandPOST1", "RepPOST", "RandPOST2", "RandRET1", "RepRET", "RandRET2", "RandGEN1", "RepGEN","RandGEN2")) +
theme(text = element_text(size = 22))