I am trying to bootstrap 95% CIs and mean values for measurements in order to examine the effect size of a treatment. The method I want to use is called LnRR or Logarithmic Response Ratio (1, 2, 3). It's calculated simply by Log(Response to treatment / Response to control)
. If the 95% CIs are not overlapping with 0, there is more than 95% probability for an effect naturally. Negative LnRR means that treatment has a negative effect.
The bootstrapping function in boot package is kind of confusing and I am struggling to calculate 95% CI's and mean values. I have tried following:
library(boot)
set.seed(2)
dat <- data.frame(treatment = rnorm(10, 1.2, 0.4), control = rnorm(10, 1.5, 0.3))
boot(dat, function(x) log(x[,1]/x[,2]), R = 999) # Because LnRR = log(dat[,1]/dat[,2])
I am clearly doing something wrong. How can I bootstrap confidence intervals (boot.ci) for this type of function? I am sure that the answer is here, but for some reason, I just can't understand how to do this.