Skip to content

Commit

Permalink
Merge branch 'aalen_johansen' of https://github.com/openpharma/savvyr
Browse files Browse the repository at this point in the history
…into aalen_johansen
  • Loading branch information
Kuenzel committed Feb 2, 2024
2 parents 9cbbf58 + 7e136f6 commit 44c2744
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/aalen_johansen.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ aalen_johansen <- function(data,

if (c1 == 0 && c2 != 0) {
help$to <- ifelse(type2 != 2, "cens", type2 - 1)
etmmm <- etm::etm(help, state_names, tra, "cens", s = 0)
etmmm <- etm::etm(help, state_names, tra, "cens", s = 0)
setmm <- summary(etmmm)[[2]]
ce_prob <- setmm[sum(setmm$time <= tau), ]$P
ce_prob_var <- setmm[sum(setmm$time <= tau), ]$var
Expand All @@ -90,7 +90,7 @@ aalen_johansen <- function(data,

if (c1 != 0 && c2 == 0) {
help$to <- ifelse(type2 != 1, "cens", type2)
etmmm <- etm::etm(help, state_names, tra, "cens", s = 0)
etmmm <- etm::etm(help, state_names, tra, "cens", s = 0)
setmm <- summary(etmmm)[[2]]

ae_prob <- setmm[sum(setmm$time <= tau), ]$P
Expand All @@ -103,7 +103,7 @@ aalen_johansen <- function(data,
tra <- matrix(FALSE, 3, 3)
tra[1, 2:3] <- TRUE
state_names <- as.character(0:2)
etmmm <- etm::etm(help, state_names, tra, "cens", s = 0)
etmmm <- etm::etm(help, state_names, tra, "cens", s = 0)
setmm <- summary(etmmm)

ae_prob <- setmm[[2]][sum(setmm[[2]]$time <= tau), ]$P
Expand Down

0 comments on commit 44c2744

Please sign in to comment.