-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgs_b.Rd
65 lines (59 loc) · 2.1 KB
/
gs_b.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gs_b.R
\name{gs_b}
\alias{gs_b}
\title{Default boundary generation}
\usage{
gs_b(par = NULL, k = NULL, ...)
}
\arguments{
\item{par}{For \code{gs_b()}, this is just Z-values for the boundaries;
can include infinite values.}
\item{k}{Is \code{NULL} (default), return \code{par}, else return \code{par[k]}.}
\item{...}{Further arguments passed to or from other methods.}
}
\value{
Returns the vector input \code{par} if \code{k} is \code{NULL}, otherwise, \code{par[k]}.
}
\description{
\code{gs_b()} is the simplest version of a function to be used with the \code{upper}
and \code{lower} arguments in \code{\link[=gs_power_npe]{gs_power_npe()}} and \code{\link[=gs_design_npe]{gs_design_npe()}} or the
\code{upper_bound} and \code{lower_bound} arguments in \code{gs_prob_combo()} and
\code{pmvnorm_combo()}.
It simply returns the vector of Z-values in the input vector \code{par} or,
if \code{k} is specified, \code{par[k]} is returned.
Note that if bounds need to change with changing information at analyses,
\code{gs_b()} should not be used.
For instance, for spending function bounds use \code{\link[=gs_spending_bound]{gs_spending_bound()}}.
}
\section{Specification}{
\if{latex}{
\itemize{
\item Validate if the input k is null as default.
\itemize{
\item If the input k is null as default, return the whole vector of
Z-values of the boundaries.
\item If the input k is not null, return the corresponding boundary
in the vector of Z-values.
}
\item Return a vector of boundaries.
}
}
\if{html}{The contents of this section are shown in PDF user manual only.}
}
\examples{
# Simple: enter a vector of length 3 for bound
gs_b(par = 4:2)
# 2nd element of par
gs_b(par = 4:2, k = 2)
# Generate an efficacy bound using a spending function
# Use Lan-DeMets spending approximation of O'Brien-Fleming bound
# as 50\%, 75\% and 100\% of final spending
# Information fraction
IF <- c(.5, .75, 1)
gs_b(par = gsDesign::gsDesign(
alpha = .025, k = length(IF),
test.type = 1, sfu = gsDesign::sfLDOF,
timing = IF
)$upper$bound)
}