Qingyang Li | 2013/03/21 | Qingyang.Li@Childmind.org
The code below reads in estimated Smoothness and:
The smoothness was estimated by AFNI's 3dFWHMx and FSL's smoothest.
Attention:
setwd("/home/data/Projects/NKI_TRT_paper/NewAnalysisWithCPAC/Smoothestimation")
library(ggplot2)
df = read.csv("/home/data/Projects/NKI_TRT_paper/NewAnalysisWithCPAC/Smoothestimation/Smoothestimation.csv")
summary(df)
## id session scan FWHMx_fsl
## Min. : 21002 session1:154 mx_1400_5Min :44 Min. :3.16
## 1st Qu.:1793622 session2:154 mx_1400_5MinDS :44 1st Qu.:3.64
## Median :3257582 mx_1400_5MinDSNF:44 Median :4.61
## Mean :3507852 mx_645_5Min :44 Mean :4.58
## 3rd Qu.:4176156 mx_645_5MinDS :44 3rd Qu.:5.28
## Max. :9630905 mx_645_5MinDSNF :44 Max. :6.93
## std_2500 :44
## FWHMy_fsl FWHMz_fsl FWHMx_afni FWHMy_afni
## Min. :3.13 Min. :2.56 Min. :3.16 Min. :3.11
## 1st Qu.:3.62 1st Qu.:3.03 1st Qu.:3.56 1st Qu.:3.62
## Median :4.16 Median :4.39 Median :4.42 Median :4.04
## Mean :4.21 Mean :4.10 Mean :4.28 Mean :4.10
## 3rd Qu.:4.63 3rd Qu.:4.93 3rd Qu.:4.94 3rd Qu.:4.54
## Max. :6.10 Max. :6.12 Max. :5.88 Max. :5.21
##
## FWHMz_afni
## Min. :2.35
## 1st Qu.:2.96
## Median :4.12
## Mean :3.88
## 3rd Qu.:4.70
## Max. :5.50
##
df2500 = subset(df, scan == "std_2500" & session == "session1")
df645 = subset(df, scan == "mx_645_5Min" & session == "session1")
# T-test, FSL
t.test(df645$FWHMx_fsl, df2500$FWHMx_fsl, paired = TRUE)
##
## Paired t-test
##
## data: df645$FWHMx_fsl and df2500$FWHMx_fsl
## t = 45.21, df = 21, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 1.465 1.607
## sample estimates:
## mean of the differences
## 1.536
t.test(df645$FWHMy_fsl, df2500$FWHMy_fsl, paired = TRUE)
##
## Paired t-test
##
## data: df645$FWHMy_fsl and df2500$FWHMy_fsl
## t = 29.73, df = 21, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.9229 1.0618
## sample estimates:
## mean of the differences
## 0.9924
t.test(df645$FWHMz_fsl, df2500$FWHMz_fsl, paired = TRUE)
##
## Paired t-test
##
## data: df645$FWHMz_fsl and df2500$FWHMz_fsl
## t = 15.84, df = 21, p-value = 3.73e-13
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.6747 0.8786
## sample estimates:
## mean of the differences
## 0.7766
# T-test, AFNI
t.test(df645$FWHMx_afni, df2500$FWHMx_afni, paired = TRUE)
##
## Paired t-test
##
## data: df645$FWHMx_afni and df2500$FWHMx_afni
## t = 24.03, df = 21, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.5730 0.6816
## sample estimates:
## mean of the differences
## 0.6273
t.test(df645$FWHMy_afni, df2500$FWHMy_afni, paired = TRUE)
##
## Paired t-test
##
## data: df645$FWHMy_afni and df2500$FWHMy_afni
## t = 9.69, df = 21, p-value = 3.353e-09
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.2503 0.3871
## sample estimates:
## mean of the differences
## 0.3187
t.test(df645$FWHMz_afni, df2500$FWHMz_afni, paired = TRUE)
##
## Paired t-test
##
## data: df645$FWHMz_afni and df2500$FWHMz_afni
## t = 6.941, df = 21, p-value = 7.408e-07
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.2135 0.3961
## sample estimates:
## mean of the differences
## 0.3048
p = ggplot()
p + geom_violin(data = df, mapping = aes(scan, FWHMx_fsl), alpha = 0.5) + stat_summary(data = df,
mapping = aes(scan, FWHMx_fsl), fun.y = median, geom = "point", color = "black",
fill = "black", pch = 23, size = 2) + geom_violin(data = df, mapping = aes(scan,
FWHMx_afni), alpha = 0.5, color = "red") + stat_summary(data = df, mapping = aes(scan,
FWHMx_afni), fun.y = median, geom = "point", color = "red", fill = "red",
pch = 23, size = 2) + facet_grid(session ~ ., scales = "fixed", space = "fixed") +
ggtitle("FWHMx") + xlab("Scan Type") + ylab("Estimated Smoothness")
# Plot FWHMy
p = ggplot()
p + geom_violin(data = df, mapping = aes(scan, FWHMy_fsl), alpha = 0.5) + stat_summary(data = df,
mapping = aes(scan, FWHMy_fsl), fun.y = median, geom = "point", color = "black",
fill = "black", pch = 23, size = 2) + geom_violin(data = df, mapping = aes(scan,
FWHMy_afni), alpha = 0.5, color = "red") + stat_summary(data = df, mapping = aes(scan,
FWHMy_afni), fun.y = median, geom = "point", color = "red", fill = "red",
pch = 23, size = 2) + facet_grid(session ~ ., scales = "fixed", space = "fixed") +
ggtitle("FWHMy") + xlab("Scan Type") + ylab("Estimated Smoothness")
# Plot FWHMz
p = ggplot()
p + geom_violin(data = df, mapping = aes(scan, FWHMz_fsl), alpha = 0.5) + stat_summary(data = df,
mapping = aes(scan, FWHMz_fsl), fun.y = median, geom = "point", color = "black",
fill = "black", pch = 23, size = 2) + geom_violin(data = df, mapping = aes(scan,
FWHMz_afni), alpha = 0.5, color = "red") + stat_summary(data = df, mapping = aes(scan,
FWHMz_afni), fun.y = median, geom = "point", color = "red", fill = "red",
pch = 23, size = 2) + facet_grid(session ~ ., scales = "fixed", space = "fixed") +
ggtitle("FWHMz") + xlab("Scan Type") + ylab("Estimated Smoothness")