Skip to content

Commit 7ad8bee

Browse files
authored
Merge pull request #183 from keaven/180-allow-multiple-alpha-levels-to-gsboundsummary-table
180 allow multiple alpha levels to `gsBoundSummary` table
2 parents 6b9153c + 249fe3f commit 7ad8bee

File tree

5 files changed

+489
-200
lines changed

5 files changed

+489
-200
lines changed

R/gsCP.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,11 @@ gsCP <- function(x, theta = NULL, i = 1, zi = 0, r = 18) {
228228
# } else if (test.type > 1 && zi < x$lower$bound[i]) {
229229
# stop("gsCP must have x$lower$bound[i]<=zi<=x$upper$bound[i]")
230230
# }
231-
232-
if (is.null(theta)) theta <- c(zi/sqrt(x$n.I[i]), 0, x$delta)
231+
# 20250208 KA added check for that x$delta is there, if needed
232+
# This is needed when input is generated by gsProbability
233+
234+
# Default is to use estimated theta based on interim z, theta = 0 (conditional error) and delta or, if none, last theta
235+
if (is.null(theta)) theta <- c(zi/sqrt(x$n.I[i]), 0, ifelse(!is.null(x$delta), x$delta, x$theta[length(x$theta)]))
233236

234237
knew <- x$k - i
235238
Inew <- x$n.I[(i + 1):x$k] - x$n.I[i]
@@ -374,7 +377,7 @@ gsPI <- function(x, i = 1, zi = 0, j = 2, level = .95, theta = c(0, 3), wgts = c
374377
# gsBoundCP function [sinew] ----
375378
gsBoundCP <- function(x, theta = "thetahat", r = 18) {
376379
if (!(inherits(x, "gsProbability") || inherits(x, "gsDesign"))) {
377-
stop("gsPI: class(x) must be gsProbability or gsDesign")
380+
stop("gsBoundCP: class(x) must be gsProbability or gsDesign")
378381
}
379382
checkScalar(r, "integer", c(1, 70))
380383
if (!is.character(theta)) {

0 commit comments

Comments
 (0)