-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathgs_design_rd.Rd
More file actions
163 lines (140 loc) · 4.98 KB
/
gs_design_rd.Rd
File metadata and controls
163 lines (140 loc) · 4.98 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gs_design_rd.R
\name{gs_design_rd}
\alias{gs_design_rd}
\title{Group sequential design of binary outcome measuring in risk difference}
\usage{
gs_design_rd(
p_c = tibble::tibble(stratum = "All", rate = 0.2),
p_e = tibble::tibble(stratum = "All", rate = 0.15),
info_frac = 1:3/3,
rd0 = 0,
alpha = 0.025,
beta = 0.1,
ratio = 1,
stratum_prev = NULL,
weight = c("unstratified", "ss", "invar", "mr"),
upper = gs_b,
lower = gs_b,
upar = gsDesign(k = 3, test.type = 1, sfu = sfLDOF, sfupar = NULL)$upper$bound,
lpar = c(qnorm(0.1), rep(-Inf, 2)),
test_upper = TRUE,
test_lower = TRUE,
info_scale = c("h0_h1_info", "h0_info", "h1_info"),
binding = FALSE,
r = 18,
tol = 1e-06,
h1_spending = TRUE
)
}
\arguments{
\item{p_c}{Rate at the control group.}
\item{p_e}{Rate at the experimental group.}
\item{info_frac}{Statistical information fraction.}
\item{rd0}{Treatment effect under super-superiority designs, the default is 0.}
\item{alpha}{One-sided Type I error.}
\item{beta}{Type II error.}
\item{ratio}{Experimental:Control randomization ratio (not yet implemented).}
\item{stratum_prev}{Randomization ratio of different stratum.
If it is unstratified design then \code{NULL}.
Otherwise it is a tibble containing two columns (stratum and prevalence).}
\item{weight}{The weighting scheme for stratified population.}
\item{upper}{Function to compute upper bound.}
\item{lower}{Function to compute lower bound.}
\item{upar}{Parameters passed to \code{upper}.}
\item{lpar}{Parameters passed to \code{lower}.}
\item{test_upper}{Indicator of which analyses should include an upper
(efficacy) bound; single value of \code{TRUE} (default) indicates all analyses;
otherwise, a logical vector of the same length as \code{info} should indicate
which analyses will have an efficacy bound.}
\item{test_lower}{Indicator of which analyses should include an lower bound;
single value of \code{TRUE} (default) indicates all analyses;
single value of \code{FALSE} indicates no lower bound; otherwise,
a logical vector of the same length as \code{info} should indicate which
analyses will have a lower bound.}
\item{info_scale}{Information scale for calculation. Options are:
\itemize{
\item \code{"h0_h1_info"} (default): variance under both null and alternative hypotheses is used.
\item \code{"h0_info"}: variance under null hypothesis is used.
\item \code{"h1_info"}: variance under alternative hypothesis is used.
}}
\item{binding}{Indicator of whether futility bound is binding;
default of \code{FALSE} is recommended.}
\item{r}{Integer value controlling grid for numerical integration
as in Jennison and Turnbull (2000); default is 18, range is 1 to 80.
Larger values provide larger number of grid points and greater accuracy.
Normally, \code{r} will not be changed by the user.}
\item{tol}{Tolerance parameter for boundary convergence (on Z-scale).}
\item{h1_spending}{Indicator that lower bound to be set by
spending under alternate hypothesis (input \code{fail_rate})
if spending is used for lower bound.}
}
\value{
A list with input parameters, analysis, and bound.
}
\description{
Group sequential design of binary outcome measuring in risk difference
}
\details{
To be added.
}
\examples{
library(gsDesign)
# Example 1 ----
# unstratified group sequential design
x <- gs_design_rd(
p_c = tibble::tibble(stratum = "All", rate = .2),
p_e = tibble::tibble(stratum = "All", rate = .15),
info_frac = c(0.7, 1),
rd0 = 0,
alpha = .025,
beta = .1,
ratio = 1,
stratum_prev = NULL,
weight = "unstratified",
upper = gs_b,
lower = gs_b,
upar = gsDesign(k = 2, test.type = 1, sfu = sfLDOF, sfupar = NULL)$upper$bound,
lpar = c(qnorm(.1), rep(-Inf, 2))
)
y <- gs_power_rd(
p_c = tibble::tibble(stratum = "All", rate = .2),
p_e = tibble::tibble(stratum = "All", rate = .15),
n = tibble::tibble(stratum = "All", n = x$analysis$n, analysis = 1:2),
rd0 = 0,
ratio = 1,
weight = "unstratified",
upper = gs_b,
lower = gs_b,
upar = gsDesign(k = 2, test.type = 1, sfu = sfLDOF, sfupar = NULL)$upper$bound,
lpar = c(qnorm(.1), rep(-Inf, 2))
)
# The above 2 design share the same power with the same sample size and treatment effect
x$bound$probability[x$bound$bound == "upper" & x$bound$analysis == 2]
y$bound$probability[y$bound$bound == "upper" & y$bound$analysis == 2]
# Example 2 ----
# stratified group sequential design
gs_design_rd(
p_c = tibble::tibble(
stratum = c("biomarker positive", "biomarker negative"),
rate = c(.2, .25)
),
p_e = tibble::tibble(
stratum = c("biomarker positive", "biomarker negative"),
rate = c(.15, .22)
),
info_frac = c(0.7, 1),
rd0 = 0,
alpha = .025,
beta = .1,
ratio = 1,
stratum_prev = tibble::tibble(
stratum = c("biomarker positive", "biomarker negative"),
prevalence = c(.4, .6)
),
weight = "ss",
upper = gs_spending_bound, lower = gs_b,
upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, param = NULL, timing = NULL),
lpar = rep(-Inf, 2)
)
}