Skip to content

Commit

Permalink
Merge pull request #270 from Merck/269-correct-milestone-z-statistcis
Browse files Browse the repository at this point in the history
Correct the denominator of the z-score of milestone tests
  • Loading branch information
LittleBeannie authored Aug 16, 2024
2 parents b2b431c + f251d24 commit 58d45ce
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 142 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: simtrial
Type: Package
Title: Clinical Trial Simulation
Version: 0.4.1.7
Version: 0.4.1.8
Authors@R: c(
person("Keaven", "Anderson", email = "keaven_anderson@merck.com", role = c("aut")),
person("Yujie", "Zhao", email = "yujie.zhao@merck.com", role = c("ctb","cre")),
Expand Down
6 changes: 3 additions & 3 deletions R/milestone.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ milestone <- function(data, ms_time, test_type = c("log-log", "naive")) {
} else {
if (test_type == "naive") {
z_numerator <- surv_diff
z_denominator <- surv_exp * sqrt(sigma2_exp) + surv_ctrl * sqrt(sigma2_ctrl)
z_denominator <- sqrt(surv_exp^2 * sigma2_exp + surv_ctrl^2 * sigma2_ctrl)
} else if (test_type == "log-log") {
z_numerator <- log(-log(surv_exp)) - log(-log(surv_ctrl))
z_denominator <- sqrt(sigma2_exp) / log(surv_exp) + sqrt(sigma2_ctrl) / log(surv_ctrl)
z_numerator <- -(log(-log(surv_exp)) - log(-log(surv_ctrl)))
z_denominator <- sqrt(sigma2_exp / log(surv_exp)^2 + sigma2_ctrl / log(surv_ctrl)^2)
}
}

Expand Down
74 changes: 0 additions & 74 deletions tests/testthat/helper-sim_gs_n.R

This file was deleted.

Loading

0 comments on commit 58d45ce

Please sign in to comment.