CI <- c(.2, .4)
LU <- c(.1, .3)
is.CI_within(CI, LU) # not within tolerable interval
is.CI_within(CI, c(0, .5)) # is within wider interval
# complement indicates if CI is outside interval
!is.CI_within(CI, LU)
#####
# for superiority test
is.CI_within(CI, c(.1, Inf)) # CI is within tolerable interval
# for inferiority test
is.CI_within(CI, c(-Inf, .3)) # CI is not within tolerable interval
Run the code above in your browser using DataLab