TwoSampleNormalGamma: Functions to Support the Two Sample Continuous Scenario

Description Usage Arguments Examples

Description

make.ts.ng.ppp: Make Two Sample Normal-Gamma Prior/Posterior Plot. Returns a ggplot object.

make.ts.ng.spp: Make Two Sample Normal-Gamma Shaded Posterior Plot. Returns a graphic built using grid.arrange.

get.ts.ng.trt.oc.df: Get Two Sample Normal-Gamma Treatment Effect OC. Returns a data.frame.

make.ts.ng.trt.oc1: Make Two Sample Normal-Gamma Treatment Effect. Returns a graphic built using grid.arrange.

make.ts.ng.trt.oc2: Make Two Sample Normal-Gamma Treatment Effect. Returns a graphic built using grid.arrange.

get.ts.ng.ssize.oc.df: Get Two Sample Normal-Gamma sample size OC data.frame. Returns a data.frame.

make.ts.ng.ssize.oc: Make Two Sample Normal-Gamma Sample size OC plot

Usage

  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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
make.ts.ng.ppp(
  mu.0.c = 0,
  alpha.c = 0.25,
  beta.c = 1,
  n.0.c = 1,
  mu.0.t = 0,
  alpha.t = 0.25,
  beta.t = 1,
  n.0.t = 1,
  xbar.c = 1.5,
  s.c = 4,
  n.c = 40,
  xbar.t = 3,
  s.t = 4,
  n.t = 40
)

make.ts.ng.spp(
  mu.0.c = 0,
  alpha.c = 0.25,
  beta.c = 1,
  n.0.c = 1,
  mu.0.t = 0,
  alpha.t = 0.25,
  beta.t = 1,
  n.0.t = 1,
  xbar.c = 1.5,
  s.c = 4,
  n.c = 40,
  xbar.t = 26,
  s.t = 4,
  n.t = 40,
  Delta.lrv = 1,
  Delta.tv = 1.5,
  tau.ng = 0.65,
  tau.lrv = 0.8,
  tau.tv = 0.1,
  seed = 1234,
  n.MC = 1000,
  nlines = 25,
  nlines.ria = 20,
  tsize = 4
)

get.ts.ng.mc.df(
  mu.0.c = 0,
  n.0.c = 10,
  alpha.0.c = 0.25 * 4,
  beta.0.c = 1 * 4,
  xbar.c = seq(-3, 3, length.out = 20),
  s.c = 3,
  n.c = 25,
  group.c = "Control",
  mu.0.t = 0,
  n.0.t = 10,
  alpha.0.t = 0.25 * 4,
  beta.0.t = 1 * 4,
  xbar.t = seq(0, 6, length.out = 20),
  s.t = 2,
  n.t = 25,
  group.t = "Treatment",
  Delta.tv = 1.75,
  Delta.lrv = 1.5,
  tau.tv = 1,
  tau.lrv = 1,
  tau.ng = 0.65,
  n.MC = 1000,
  seed = 1234
)

get.ts.ng.mc(
  mu.0.c = 1.5,
  n.0.c = 1,
  alpha.0.c = 0.25,
  beta.0.c = 1,
  xbar.c = 1.5,
  s.c = 1,
  n.c = 25,
  group.c = "Control",
  mu.0.t = 1.75,
  n.0.t = 1,
  alpha.0.t = 0.25,
  beta.0.t = 1,
  xbar.t = 0,
  s.t = 1,
  n.t = 25,
  group.t = "Treatment",
  Delta.tv = 1.5,
  Delta.lrv = 1,
  tau.tv = 1,
  tau.lrv = 1,
  tau.ng = 0.35,
  seed = 1234,
  n.MC = 5000
)

get.ts.ng.decision(
  mu.0.c = 1.5,
  n.0.c = 10,
  alpha.0.c = 0.25 * 4,
  beta.0.c = 1 * 4,
  xbar.c = 1.5,
  s.c = 1,
  n.c = 25,
  group.c = "Control",
  mu.0.t = 1.75,
  n.0.t = 10,
  alpha.0.t = 0.25 * 4,
  beta.0.t = 1 * 4,
  xbar.t = 1.85,
  s.t = 1,
  n.t = 25,
  group.t = "Treatment",
  Delta.tv = 0.5,
  Delta.lrv = 0.25,
  tau.tv = 1,
  tau.lrv = 1,
  tau.ng = 0.35,
  seed = 1234,
  n.MC = 1000
)

get.ts.ng.trt.oc.df(
  mu.0.c = 0,
  n.0.c = 1,
  alpha.0.c = 0.25,
  beta.0.c = 1,
  xbar.c = 1.5,
  s.c = 2,
  group.c = "Control",
  mu.0.t = 3.75,
  n.0.t = 1,
  alpha.0.t = 0.25,
  beta.0.t = 1,
  xbar.t = 1.85,
  s.t = 2,
  group.t = "Treatment",
  Delta.LB = 0,
  Delta.UB = 5,
  ARatio = 1,
  N = 50,
  Delta.tv = 2.5,
  Delta.lrv = 1.5,
  Delta.user = 4,
  tau.tv = 1,
  tau.lrv = 1,
  tau.ng = 0.65,
  npoints = 5,
  n.MC = 500,
  seed = 1234
)

make.ts.ng.trt.oc1(for.plot = get.ts.ng.trt.oc.df(), nlines = 20, tsize = 4)

make.ts.ng.trt.oc2(for.plot = get.ts.ng.trt.oc.df(), nlines = 25, tsize = 4)

get.ts.ng.ssize.oc.df(
  mu.0.c = 0,
  n.0.c = 1,
  alpha.0.c = 0.25,
  beta.0.c = 1,
  s.c = 2,
  group.c = "Control",
  mu.0.t = 3.75,
  n.0.t = 1,
  alpha.0.t = 0.25,
  beta.0.t = 1,
  s.t = 2,
  group.t = "Treatment",
  ARatio = 2,
  N = 50,
  n_LB_OC = floor(50 * 0.75),
  n_UB_OC = floor(50 * 2),
  Delta.tv = 2.5,
  Delta.lrv = 1.5,
  Delta.user = 4,
  tau.tv = 0.1,
  tau.lrv = 0.2,
  tau.ng = 0.35,
  npoints = 10,
  n.MC = 500,
  seed = 1234
)

make.ts.ng.ssize.oc(for.plot = get.ts.ng.ssize.oc.df(), tsize = 4, nlines = 25)

Arguments

mu.0.c

prior mean for control group

n.0.c

prior effective sample size for control group

mu.0.t

prior mean for treatment group

n.0.t

prior effective sample size for treatment group

xbar.c

observed sample mean for control group

s.c

observed sample standard deviation for control group

n.c

sample size for control group

xbar.t

observed sample mean for treatment group

s.t

observed sample standard deviation for treatment group

n.t

sample size for treatment group

Delta.lrv

TPP Lower Reference Value aka Min TPP

Delta.tv

TPP Target Value aka Base TPP

tau.ng

threshold associated with No-Go

tau.lrv

threshold associated with Min TPP

tau.tv

threshold associated with Base TPP

seed

random seed

n.MC

Number of MC samples

nlines

Control for text spacing

nlines.ria

Control for text spacing

tsize

Control for text size

alpha.0.c

prior alpha parameter for control group

beta.0.c

prior beta parameter for control group

alpha.0.t

prior alpha parameter for treatment group

beta.0.t

prior beta parameter for treatment group

Delta.LB

Lower bound for treatment effect

Delta.UB

Upper bound for treatment effect

ARatio

Allocation ratio

npoints

number of points

n_LB_OC

Lower bound for sample size

n_UB_OC

Upper bound for sample size

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

lylyf1987/GNGpkg documentation built on May 19, 2020, 12:07 a.m.