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