讀取檔案
長寬表互換
library(reshape2)
data <- melt(dta, id.vars=c("Group"))
colnames(data)[2:3] <- c("Time", "RTime")
names(data)## [1] "Group" "Time" "RTime"
兩組平均數
## data$Group data$RTime
## 1 non-schizo 310.1697
## 2 schizo 506.8667
T考驗
##
## Welch Two Sample t-test
##
## data: data$RTime by data$Group
## t = -9.8771, df = 190.98, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -235.9773 -157.4166
## sample estimates:
## mean in group non-schizo mean in group schizo
## 310.1697 506.8667