solveWorstCaseTheta2x2PropDiff: Worst-case baseline of the propDiff grow test

View source: R/newsafe2x2Test.R

solveWorstCaseTheta2x2PropDiffR Documentation

Worst-case baseline of the propDiff grow test

Description

The pair on the curve of each alternative at which the e-process grows slowest, so a block count planned there holds for every baseline. The expected log e-increment per block is the KL divergence of the truth from its pooled null projection,

R(theta) = nLow KL(theta || theta0) + nHigh KL(theta + d || theta0),
theta0   = theta + nHigh d / (nLow + nHigh),

with theta the lower proportion, nLow its group size and nHigh the size of the group at theta + d. Its minimiser is the root of

nLow logit(theta) + nHigh logit(theta + d) = (nLow + nHigh) logit(theta0),

summed over blocks when the sizes vary per block. Equal sizes give exactly the midpoint (1 - d) / 2; in general the root is (1 - d) / 2 + d (nHigh - nLow) / (6 (nLow + nHigh)) + O(d^3). The rate ignores the first-block UMP factor, which moves the simulated worst case when one group is very small.

Usage

solveWorstCaseTheta2x2PropDiff(
  propDiffMin,
  na,
  nb,
  alternative = c("twoSided", "greater", "less")
)

Arguments

propDiffMin

numeric in (-1, 1) that defines the minimal relevant difference in proportions thetaA - thetaB, the smallest difference that we would like to detect (with sufficient power).

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.

alternative

a character string specifying the alternative hypothesis. Must be one of "twoSided" (default), "greater" or "less", where "greater" means that group A has the larger proportion.

Details

"greater": thetaA = thetaB + d, so thetaB is the lower proportion and nLow = nb. "less": thetaA = thetaB - d, so thetaA is the lower one and nLow = na. "twoSided" gives both, greater first.

Value

A data frame with one row per curve and columns thetaA, thetaB.


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