tests/testthat/test2.R

library(rsurv)

n <- 100
simdata <- data.frame(
  age = rnorm(n),
  sex = sample(c("f", "m"), size = n, replace = TRUE)
) |>
  mutate(
    time = rphreg(u = runif(n), ~ age+sex, beta = c(1, 0.5), dist = "weibull", scale = 2, shape = 1.5),
    rinterval(time, tau = seq(0, 5, by = 1), type = "II", prob = 0.7)
  )

Try the rsurv package in your browser

Any scripts or data that you put into this service are public.

rsurv documentation built on Oct. 30, 2024, 9:08 a.m.