I am using bootstrapping to calculate confidence intervals for a risk ratio. In some of the bootstrapped samples, there are no observations of one of the outcomes, leading to the risk ratio being value / 0. Thus, when I try to calculate the SE, I get a NaN value in R, and thus an Inf upper CI.

How should I calculate the standard error and confidence intervals with a risk ratio? I have a very small sample within strata (and need to calculate the risk ratio in the strata.)

  • $\begingroup$ You could try something like Laplace smoothing. Estimate the mean in each group using $(1 + \sum x_i) / (1 + N)$. This would ensure a non-zero denominator. i'm not sure what kind of bias this would impart so you might want to simulate it $\endgroup$ Commented Apr 8, 2023 at 3:34
  • $\begingroup$ And if you use percentile method? $\endgroup$
    – rep_ho
    Commented Apr 8, 2023 at 7:25


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.