#setwd("~/Documents/PMC_TMS_Analysis")
require(ggplot2)
require(xlsx)
data = read.xlsx("Recruitmentcurve_results_MASTER_temp.xlsx", sheetIndex = 4)
data$group = as.factor(data$group)
data = data[data$Task.Difficulty == "4-color",]
Inflection Point 1-way ANOVA
oneway.test(Inf_delta ~ group, data = data, var.equal = T)
One-way analysis of means
data: Inf_delta and group
F = 0.5976, num df = 2, denom df = 23, p-value = 0.5584
AUC 1-Way ANOVA
oneway.test(AUC_delta ~ group, data = data, var.equal = T)
One-way analysis of means
data: AUC_delta and group
F = 0.1756, num df = 2, denom df = 23, p-value = 0.8401
Slope 1-Way ANOVA
oneway.test(Slope_delta ~ group, data = data, var.equal = T)
One-way analysis of means
data: Slope_delta and group
F = 0.30907, num df = 2, denom df = 23, p-value = 0.7371
Plot: Inflection Point 1 point not shown in plot, PMC subject with Inflection = ~120
ggplot(data, aes(x=group, y=Inf_delta, color = group)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') + ylim(-10,10) +
theme(text = element_text(size = 24))
Plot: AUC
ggplot(data, aes(x=group, y=AUC_delta, color = group)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') +
theme(text = element_text(size = 24))
Plot: Slope
#4-color = data[data$]
ggplot(data, aes(x=group, y=Slope_delta, color = group)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') +
theme(text = element_text(size = 24))
Plot: Slope w/ 4-color only
data$Task.Difficulty = factor(data$Task.Difficulty)
four_color = data[data$Task.Difficulty == "4-color",]
ggplot(four_color, aes(x=group, y=Slope_delta, color = group)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') +
ylab(expression(paste(Delta,"Slope"))) + xlab("TMS Groups") +
theme(text = element_text(size = 24))
#+ ylim(-10,30)
Plot: Slope 2 VS 4 COLOR
data = read.xlsx("Recruitmentcurve_results_MASTER_temp.xlsx", sheetIndex = 4)
data$group = as.factor(data$group)
data$Task.Difficulty = factor(data$Task.Difficulty)
ggplot(data[data$group == "Control",], aes(x=Task.Difficulty, y=Slope_delta, color = Task.Difficulty)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') +
ylab(expression(paste(Delta,"Slope"))) + xlab("Task Difficulty") + scale_color_manual(values=c("#999999", "#F8766D")) +
theme(text = element_text(size = 24))
#+ ylim(-10,30)
T-test: Controls pre vs post, Inflection
cont_data = read.xlsx("Recruitmentcurve_results_MASTER_temp.xlsx", sheetIndex = 3)
t.test(cont_data$Δ.Inf.., mu = 0, alternative = "two.sided")
One Sample t-test
data: cont_data$Δ.Inf..
t = 0.70531, df = 19, p-value = 0.4892
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
-1.987838 4.008476
sample estimates:
mean of x
1.010319
T-test: Controls pre vs post, AUC
t.test(cont_data$Δ.AUC, mu = 0, alternative = "two.sided")
One Sample t-test
data: cont_data$Δ.AUC
t = 0.38535, df = 19, p-value = 0.7043
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
-110.5958 160.5095
sample estimates:
mean of x
24.95682
T-test: Controls pre vs post, Slope
t.test(cont_data$Δ.Slope, mu = 0, alternative = "greater")
One Sample t-test
data: cont_data$Δ.Slope
t = 1.7231, df = 19, p-value = 0.05055
alternative hypothesis: true mean is greater than 0
95 percent confidence interval:
-0.003279286 Inf
sample estimates:
mean of x
0.934295
cont_data = read.xlsx("Recruitmentcurve_results_MASTER_temp.xlsx", sheetIndex = 5)
ggplot(cont_data, aes(x=Time, y=Slope, color = Time)) +
geom_boxplot()+
geom_dotplot(binaxis='y', stackdir='center') +
ylab("Slope") + xlab("Time") + scale_color_manual(values=c("#999999", "#F8766D")) + scale_x_discrete(limits=c("Pre", "Post")) +
theme(text = element_text(size = 24))
Recruitment Curve
recruit = read.xlsx("RecruitmentCurve31.xlsx", sheetIndex = 1)
ggplot(data = recruit, aes(x = Condition, y = mep.Amplitude, color = Time)) +
geom_smooth(method = "loess") +
theme(text = element_text(size = 24))