
Adjusted Significance Level of Blinded Sample Size Re-Estimation for Paired Binary Data
Source:R/PairedAlphaAdjBSSR.R
PairedAlphaAdjBSSR.RdLowers the nominal significance level of a matched-pairs design with blinded sample
size re-estimation until the largest type I error rate over the probability of a
discordant pair on the boundary of the null hypothesis does not exceed the target level
alpha, and returns the adjusted level together with that of the fixed design.
Usage
PairedAlphaAdjBSSR(
Delta.A,
N,
omega = NULL,
alpha,
tar.power,
Test,
restricted = FALSE,
alternative = c("greater", "less", "two.sided", "equivalence"),
n.grid = 100,
bb.gamma = 0,
ss.method = c("exact", "standard", "conditional.power"),
ss.Test = Test,
ss.alpha = alpha,
search = c("crossing", "smallest", "stable"),
search.limit = c(2, 50),
N.min = NULL,
N.max = NULL,
n.interim = NULL,
psi = seq(0, 1, by = 0.01),
maximize = c("certified", "refined", "grid"),
adjust = c("test", "both"),
tol = 1e-08,
step = 1e-05,
margin = 0,
ref.pvalue = FALSE
)Arguments
- Delta.A
Assumed difference
p10 - p01used in the re-estimation- N
Planned number of pairs, which is the number of pairs of the fixed design
- omega
Fraction of
Nat the interim analysis, rounded up. Supply eitheromegaorn.interim- alpha
Target level of significance, which the type I error rate must not exceed
- tar.power
Target power of the re-estimation
- Test
Type of statistical test. Options:
'McNemar','McNemar-cc','McNemar-exact','McNemar-midP','McNemar-uncond'or'Paired-Score'- restricted
Logical. If
TRUE, the final number of pairs is at leastN. Default isFALSE- alternative
Direction of the alternative hypothesis. Options:
'greater'(default) forp10 - p01 > -margin,'less'forp10 - p01 < margin,'two.sided'forp10 != p01, or'equivalence'for-lower < p10 - p01 < upper- n.grid
Number of grid points used to search over the probability of a discordant pair in the test
'McNemar-uncond'. Default is 100- bb.gamma
Confidence level parameter of the Berger-Boos procedure for the test
'McNemar-uncond'. The default of 0 disables the procedure- ss.method
Re-estimation rule.
'exact'(default) and'standard're-estimate the number of pairs ofPairedSampleSizewith the method of that name.'conditional.power'takes the smallest number of pairs at which the conditional power given the interim number of discordant pairs attainstar.power, the rule of Schepers et al. (2026); it requiresN.max. See Details- ss.Test
Test used in the re-estimation. Default is
Test- ss.alpha
Level of significance used for the re-estimation when
adjust = 'test'. Default isalpha. It is ignored whenadjust = 'both'- search
Search of the exact re-estimation, see
PairedSampleSize; it does not go beyondN.max- search.limit
Limit of the search
'stable', seePairedSampleSize- N.min
Smallest final number of pairs, or
NULL- N.max
Largest final number of pairs, or
NULL- n.interim
Number of pairs at the interim analysis. Supply either
omegaorn.interim- psi
Values of the probability
p10 + p01of a discordant pair at which the rate is evaluated. Values that do not lie on the boundary of the null hypothesis, below|margin|, are dropped. Default isseq(0, 1, by = 0.01)- maximize
How the largest type I error rate at a level is located, as in
PairedTypeIErrorBSSR. With'certified'(default) the adjusted level controls the type I error rate over the whole interval spanned by the values ofpsion the boundary. With'refined'and'grid'the control is assessed on the grid- adjust
Which part of the design uses the adjusted level.
'test'(default) applies it to the final analysis only, so the re-estimation keeps usingss.alpha.'both'applies it to the re-estimation as well- tol
Tolerance of the bisection, relative to
alpha, a single value in (0, 1). Default is1e-8- step
Decrement of the level in the search used when
adjust = 'both'. Default is1e-5- margin
Margin on the scale of the difference
p10 - p01. The default of 0 gives a test of superiority, and a value other than 0 tests the null hypothesisp10 - p01 <= -marginagainstp10 - p01 > -marginwhenalternativeis'greater', andp10 - p01 >= marginagainstp10 - p01 < marginwhen it is'less'. A negative value tests for superiority by more than its absolute value. A margin other than 0 requiresTest = 'Paired-Score'and a one-sided alternative. Foralternative = 'equivalence'the margin is the pairc(lower, upper), both in (0, 1), or a single value used for both, and the null hypothesisp10 - p01 <= -lowerorp10 - p01 >= upperis tested- ref.pvalue
Logical. If
TRUE, the maximization over the probability of a discordant pair in the test'McNemar-uncond'is refined between the grid points, see Details. Default isFALSE
Value
An object of class bbssr_alphaadj, a data frame with one row for the
BSSR design and one for the fixed design containing:
- Design
'BSSR'or'TRAD'- alpha
Target level
- max.TIE
Largest type I error rate at the nominal level
alpha- alpha.adj
Adjusted nominal level. It is
alphawhen the nominal level already controls the type I error rate, and 0, with a warning, when no level examined by the bisection does. The search ofadjust = 'both'for the BSSR design stops with an error instead when it reaches 0- max.TIE.adj
Largest type I error rate at the adjusted level
- psi.adj
Probability of a discordant pair at which
max.TIE.adjoccurs,NAwhenalpha.adjis 0- max.TIE.bound
Upper bound of the type I error rate at the nominal level with
maximize = 'certified', otherwiseNA- max.TIE.adj.bound
Upper bound of the type I error rate at the adjusted level with
maximize = 'certified', otherwiseNA
For alternative = 'equivalence' the column boundary.adj gives the
boundary, 'lower' or 'upper', on which max.TIE.adj occurs.
Details
The searches are those of BinaryAlphaAdjBSSR. With
adjust = 'test' the final numbers of pairs do not depend on the nominal level of
the final analysis, the largest type I error rate is a non-decreasing function of the
level, and the level is found by bisection to within tol * alpha; the reported
level is the largest value with at most six significant digits that gives the same
rejection regions. With adjust = 'both' the level is lowered from alpha
in steps of step until the type I error rate is controlled. The fixed design
always uses the bisection. With maximize = 'certified' a level is accepted only
when the upper bound of the type I error rate over the interval, computed as in
PairedTypeIErrorBSSR, does not exceed alpha.
The exact conditional McNemar test keeps its level whatever blinded rule is used (Schepers et al., 2026), so it needs no adjustment.
References
Kieser M, Friede T (2000). Re-calculating the sample size in internal pilot study designs with control of the type I error rate. Statistics in Medicine, 19(7), 901-911.
Schepers M, Brannath W, Hoffmann E, Stingl J, Schmidtmann I (2026). Blinded sample size review for McNemar's test based on primary and surrogate endpoints. arXiv:2608.17784.
Examples
# \donttest{
PairedAlphaAdjBSSR(Delta.A = 0.2, N = 40, n.interim = 20, alpha = 0.05,
tar.power = 0.8, Test = 'McNemar', alternative = 'two.sided',
ss.method = 'standard', psi = seq(0.05, 0.95, by = 0.05))
#> Adjusted significance level for blinded sample size re-estimation
#>
#> Test : McNemar
#> Alternative : two.sided
#> Adjusted part : final analysis only
#> Maximum : certified over psi in [0.05, 0.95]
#> Target level : 0.05
#>
#> Design max.TIE alpha.adj max.TIE.adj
#> BSSR 0.0505829 0.0496472 0.0495041
#> Fixed sample 0.0538321 0.0481934 0.0485610
# }