Skip to content

Commit 065eba2

Browse files
committed
updated lower bound for repeated and sequential pvalues
1 parent 03711f1 commit 065eba2

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

R/repeated_p.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,11 @@ repeated_p <- function(p,
142142

143143
# If boundary at analysis K is crossed even at alpha ~ 0,
144144
# the p-value is extremely small. Return the lower bound.
145+
# Use >= 0 to also handle the edge case where the exceedance is exactly 0
146+
# (boundary exactly crossed), which would cause uniroot to fail because
147+
# f(lower) and f(upper) would have the same sign.
145148
exc_lower <- exceedance_K(lower)
146-
if (exc_lower > 0) {
149+
if (exc_lower >= 0) {
147150
message(
148151
"Boundary crossed at alpha = ", lower,
149152
"; returning ", lower, " as a lower bound."

R/sequential_p.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,11 @@ sequential_p <- function(p,
166166

167167
# If a boundary is already crossed at the most stringent alpha (~0),
168168
# the observed p-values are extremely small. Return the lower bound.
169+
# Use >= 0 to also handle the edge case where the exceedance is exactly 0
170+
# (boundary exactly crossed), which would cause uniroot to fail because
171+
# f(lower) and f(upper) would have the same sign.
169172
exc_lower <- max_exceedance(lower)
170-
if (exc_lower > 0) {
173+
if (exc_lower >= 0) {
171174
message(
172175
"Boundary crossed at alpha = ", lower,
173176
"; returning ", lower, " as a lower bound."

0 commit comments

Comments
 (0)