We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67986b3 commit 809ed32Copy full SHA for 809ed32
R/gs_cp_npe.R
@@ -73,10 +73,10 @@ gs_cp_npe <- function(theta = NULL,
73
# ----------------------------------------- #
74
# calculate conditional power under theta #
75
76
- t_ij <- info[2] / info[1]
77
- numerator1 <- b - a * sqrt(t_ij)
78
- numerator2 <- theta[2] * sqrt(info[2]) - theta[1] * sqrt(t_ij * info[1])
79
- denominator <- sqrt(1 - t_ij)
+ t <- info[2] / info[1]
+ numerator1 <- b - a * sqrt(t)
+ numerator2 <- theta[2] * sqrt(info[2]) - theta[1] * sqrt(t * info[1])
+ denominator <- sqrt(1 - t)
80
conditional_power <- pnorm((numerator1 - numerator2) / denominator, lower.tail = FALSE)
81
82
return(conditional_power)
0 commit comments