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

View source: R/newsafe2x2Test.R

computeConfidenceInterval2x2PropDiffR Documentation

Helper function: Computes the savi confidence interval for propDiff

Description

Inverts the eBeta e-process: the predictive Beta numerator of predictiveThetas2x2() against, per block, the reverse information projection of solveRIPr2x2PropDiff() onto each candidate propDiff. The interval is the set of candidates whose e-value stays below 1 / alpha, found by one minimum and two roots on domain.

Usage

computeConfidenceInterval2x2PropDiff(
  ya,
  yb,
  na,
  nb,
  betaParameter,
  alpha,
  domain = c(-1, 1)
)

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.

betaParameter

list(betaA1, betaA2, betaB1, betaB2), the Beta prior shapes on thetaA and thetaB for "eBeta", each a single finite positive number; NULL means 1 / (2 * na) and 1 / (2 * nb), taking block 1's sizes with a warning when they vary by block. A given prior keeps its own block 1: the test does not replace it by the UMP e-value. For "grow" on propDiff, the test puts Beta(betaA1, betaA2) on thetaA rescaled to its feasible interval on the curve, B's shapes unused, and NULL means uniform; planning ignores it.

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; the domain edge when that edge is still inside, and c(-1, 1) with a warning when the set is empty.


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