Skip to content

Commit

Permalink
correct wrong data table test
Browse files Browse the repository at this point in the history
  • Loading branch information
johannespiller committed Aug 12, 2024
1 parent dd2dd6e commit dcb7495
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/testthat/test-as-ped.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ test_that("Trafo works for multi-state data without recurrent events", {
transition = c("1->3", "1->2","2->3"),
age = c(24, 36,36))

test_df <- test_df %>% filter(status == 1) %>% add_counterfactual_transitions()
test_df <- test_df %>% add_counterfactual_transitions()

print(test_df)

# CALENDAR timescale
cal_df <- as_ped_multistate(
cal_df <- as_ped(
data = test_df,
formula = Surv(tstart, tstop, status)~ .,
transition = "transition",
Expand All @@ -168,7 +168,7 @@ test_that("Trafo works for multi-state data without recurrent events", {
as.factor(c("1->2", "1->2","1->2","1->3", "1->3","1->3","2->3")))
expect_identical(
cal_df$id,
c(1, 1, 2, 1, 1, 2, 1))
c(1, 1, 2, 1, 1, 2, 2))
expect_identical(
round(cal_df$tstart, 1),
c(0.0, 1.2, 0.0, 0.0, 1.2, 0.0, 1.2))
Expand Down

0 comments on commit dcb7495

Please sign in to comment.