Skip to content

Commit

Permalink
Remove timereg comment
Browse files Browse the repository at this point in the history
  • Loading branch information
adibender committed May 27, 2020
1 parent d004a56 commit 3b12dbd
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions tests/testthat/test-cumulative-coefficients.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ test_that("Cumulative coefficients work", {
df <- tumor[1:30, c("days", "status", "age")]
df$x1 <- as.factor(rep(letters[1:3], each = nrow(df) / 3L))

## aalen model
# library(timereg)
# mod <- aalen(Surv(days, status) ~ x1 + age, data = df)
# cumu_coef_aalen <- get_cumu_coef(
# mod,
# df,
# terms = c("(Intercept)", "x1"))
# expect_data_frame(cumu_coef_aalen, nrows = 42L, ncols = 6L)
# expect_equal(unique(cumu_coef_aalen$variable), c("(Intercept)", "x1b", "x1c"))

## pam
ped <- as_ped(df, formula = Surv(days, status)~ x1 + age)
pam <- mgcv::gam(ped_status ~ s(tend) + x1 + age, data = ped,
Expand All @@ -24,11 +14,5 @@ test_that("Cumulative coefficients work", {
expect_equal(unique(cumu_coef_pam$variable), c("age", "x1 (b)", "x1 (c)"))
cumu_coef_pam <- get_cumu_coef(pam, ped, terms = c("(Intercept)", "age"))
expect_data_frame(cumu_coef_pam, nrows = 24L, ncols = 6L)
# ggplot(
# filter(cc2, variable == "(Intercept)"),
# aes(x = time, y = cumu_hazard)) +
# geom_step() +
# geom_step(data = filter(cumu_coef_aalen, variable == "(Intercept)"), col = 2)


})

0 comments on commit 3b12dbd

Please sign in to comment.