Description Usage Arguments Value Author(s) See Also Examples
Converts to missing, the survival data for subjects with events of censoring before the specified landmark times.
1 | landmark(s, tstart)
|
s |
Survival object |
tstart |
Vector of times at which landmarks occur |
An object of class Surv
.
Toby Johnson Toby.x.Johnson@gsk.com
Surv
, dynpred package
1 2 3 4 5 6 7 8 9 | library(survival)
n <- 1000 # sample size
mys <- Surv2(rexp(n, 0.1), runif(n, 0, 5)) # random survival
tlm <- runif(n, 0, 1) # time of landmark
x <- ifelse(mys[ , "time"] >= tlm, rbinom(n, 3, .5), 0)
# x is uncorrelated with mys but zero for subjects with event or
# censor before tlm==tlandmark
drop1(coxph(mys~x), test = "Chisq") # biased
drop1(coxph(landmark(mys, tlm)~x), test = "Chisq") #unbiased
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.