set.seed(1234)
n <- 500L
# Simulate interval truncated data
x <- samp_elife(n = n,
scale = 2,
shape = 1.5,
lower = low <- runif(n),
upper = upp <- runif(n, min = 3, max = 15),
type2 = "ltrt",
family = "weibull")
coef(fit_elife(
time = x,
ltrunc = low,
rtrunc = upp,
family = "weibull"))
# Simulate left-truncated right-censored data
x <- samp_elife(n = n,
scale = 2,
shape = 1.5,
lower = low <- runif(n),
upper = upp <- runif(n, min = 3, max = 15),
type2 = "ltrc",
family = "gomp")
#note that the return value is a list...
coef(fit_elife(
time = x$dat,
ltrunc = low,
event = !x$rcens,
family = "gomp"))
Run the code above in your browser using DataLab