blob: 2efa787b3f770b55f13aa54c43975b29067451ce [file] [log] [blame]
Peter Collingbournead9841e2014-11-27 00:06:42 +00001sc <- read.table(file('stdin'))
2scratio <- sc$V2 / sc$V3
3scratio <- scratio[scratio > 0]
4
5# Take the log of the ratio. Our null hypothesis is a normal distribution
6# around zero.
7tt <- t.test(log(scratio))
8tt
9
10# This gives us the geo-mean as we are taking the exponent of the linear mean
11# of logarithms.
121 - 1/exp(tt$estimate)
13
14# Likewise for the confidence interval.
151 - 1/exp(tt$conf.int)