data(truncatedscore)
mod1 <- learner_glm(y ~ a * (x1 + x2))
mod2 <- learner_glm(r ~ a * (x1 + x2), family = binomial)
a <- estimate_truncatedscore(
data = truncatedscore,
mod.y = mod1,
mod.r = mod2,
mod.a = a ~ 1,
mod.event = mets::Event(time, status) ~ x1+x2,
time = 2
)
s <- summary(a, noninf.t = -0.1)
print(s)
parameter(s)
# the above is equivalent to
# a <- estimate_truncatedscore(
# data = truncatedscore,
# mod.y = y ~ a * (x1 + x2),
# mod.r = r ~ a * (x1 + x2),
# mod.a = a ~ 1,
# mod.event = mets::Event(time, status) ~ x1+x2,
# time = 2
# )
Run the code above in your browser using DataLab