computeConfidenceInterval2x2LogOdds: Helper function: Computes the savi confidence interval for...

View source: R/newsafe2x2Test.R

computeConfidenceInterval2x2LogOddsR Documentation

Helper function: Computes the savi confidence interval for logOdds

Description

Inverts the eGauss numerator: the interval is the set of logOdds values at which the numerator over the conditional likelihood of logLikelihoodFNCH() stays below 1 / alpha, found by one minimum and two roots on domain.

Usage

computeConfidenceInterval2x2LogOdds(
  ya,
  yb,
  na,
  nb,
  logPTotal,
  alpha,
  domain = c(-40, 40)
)

Arguments

ya

positive observations/ events per data block in group A: a numeric with integer values between (and including) 0 and na, the number of observations in group A per block.

yb

positive observations/ events per data block in group B: a numeric with integer values between (and including) 0 and nb, the number of observations in group B per block.

na

number of observations in group A per data block, one value or one per block.

nb

number of observations in group B per data block, one value or one per block.

logPTotal

numeric, the eGauss log numerator on all blocks: the plain cumulative log e-value plus the cumulative hypergeometric log likelihood.

alpha

numeric in (0, 1), one minus the confidence level.

domain

c(lower, upper), the candidates searched.

Value

numeric vector that contains the lower and upper bound of the savi confidence interval, named lowerBound, upperBound; NA with a warning for a bound that lies beyond domain, and the whole domain with a warning when the set is empty.


safestats documentation built on Oct. 5, 2026, 9:07 a.m.