File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 123
123
# ' b = x$bound$z[x$bound$bound == "upper" & x$bound$analysis == 3])
124
124
gs_cp_npe <- function (theta = NULL ,
125
125
info = NULL ,
126
- max_info = max(info ),
127
126
a = NULL , b = NULL
128
127
) {
129
128
# ----------------------------------------- #
@@ -153,9 +152,10 @@ gs_cp_npe <- function(theta = NULL,
153
152
# ----------------------------------------- #
154
153
# calculate conditional power under theta #
155
154
# ----------------------------------------- #
156
- numerator1 <- sqrt(b * info_frac [2 ]) - a * sqrt(info_frac [1 ])
157
- numerator2 <- theta [2 ] * sqrt(info_frac [2 ] * info [2 ]) - theta [1 ] * sqrt(info_frac [1 ] * info [1 ])
158
- denominator <- sqrt(info_frac [2 ] - info_frac [1 ])
155
+ t_ij <- info [2 ] / info [1 ]
156
+ numerator1 <- b - a * sqrt(t_ij )
157
+ numerator2 <- theta [2 ] * sqrt(info [2 ]) - theta [1 ] * sqrt(t_ij * info [1 ])
158
+ denominator <- sqrt(1 - t_ij )
159
159
conditional_power <- pnorm((numerator1 - numerator2 ) / denominator , lower.tail = FALSE )
160
160
161
161
return (conditional_power )
You can’t perform that action at this time.
0 commit comments