Nelson Aalen estimate in mice

Viewed 148

So I am dealing with the imputation of data set having time to event data. Several papers suggest that the use of Nelson-Aalen estimate (as an approximation to the baseline hazard) will provide better imputation results. Is there a way to find Nelson-Aalen estimate and bind to my data set in R. I have found a function named nelsonaalen(data, time, event) in the mice package but I am afraid whether it will cause any error since I can only include one time variable(failure time) in it. The variables in my data are as follows:

  N = 1000 
  xt=runif(N, 0, 50)
  x1=rnorm(N, 2, 1) 
  x2=rnorm(N, -2, 1)
  x3 <- rnorm(N, 0.5*x1 + 0.5*x2, 2)
  x4 <- rnorm(N, 0.3333*x1 + 0.3333*x2 + 0.3333*x3, 2 )
  lp <-   0.05*x1 + 0.2*x2 + 0.1*x3 + 0.02*x4 
  T <- qweibull(runif(N,pweibull(xt,shape = 7.5, scale = 84*exp(-lp/7.5)),1), shape=7.5, scale=84*exp(-lp/7.5))
  Cens1 <- 100
  time_M <- pmin(T,Cens1)
  event_M <- time_M == Tm  

Here xt denotes starting time, T denotes the failure time and the x1 to x4 are my covariates in which I'll create missing values in two of the covariates (x3 and x4).

0 Answers
Related