## Classical example: Student's sleep data
data(sleep)
plot(extra ~ group, data = sleep)
## t.test() gives a t value of -4.0621
t.test(sleep$extra[1:10], sleep$extra[11:20], paired=TRUE)
## Gives a Bayes factor of about 15
## in favor of the alternative hypothesis
result <- ttest.tstat(t = -4.0621, n1 = 10)
exp(result[['bf']])
Run the code above in your browser using DataLab