| 1 |
skip_on_cran() |
| 2 |
|
| 3 |
skip_if_not_installed("modeltests") |
| 4 |
library(modeltests) |
| 5 |
|
| 6 |
skip_if_not_installed("survival") |
| 7 |
suppressPackageStartupMessages(library(survival)) |
| 8 |
|
| 9 |
fit <- suppressWarnings( |
| 10 |
survexp( |
| 11 |
futime ~ 1, |
| 12 |
rmap = list( |
| 13 |
sex = "male", |
| 14 |
year = accept.dt, |
| 15 |
age = accept.dt - birth.dt |
| 16 |
), |
| 17 |
method = "conditional", |
| 18 |
data = jasa |
| 19 |
) |
| 20 |
) |
| 21 |
|
| 22 |
test_that("survfit tidier arguments", { |
| 23 |
check_arguments(tidy.survexp) |
| 24 |
check_arguments(glance.survexp) |
| 25 |
}) |
| 26 |
|
| 27 |
test_that("tidy.survexp", { |
| 28 |
td <- tidy(fit) |
| 29 |
check_tidy_output(td) |
| 30 |
}) |
| 31 |
|
| 32 |
test_that("glance.survexp", { |
| 33 |
gl <- glance(fit) |
| 34 |
check_glance_outputs(gl) |
| 35 |
}) |