Why do NAs appear in my survival estimate when I have a large dataset?
FloBlue opened this issue · comments
Hello,
I am using the frailtySurv
package to obtain estimates of the cumulative hazard of frailty survival data.
However, I noticed that when I am asking estimates on a large dataset, NAs appear at the end letting an incomplete estimation.
Maybe, this is a known issue and how can I prevent this?
Thanks in advance!
library(frailtySurv)
n= 3000
data = as.data.frame(cbind(time= runif(n, 0.01,20), status = rbinom(n,1, 0.6), cov = rbinom(n,1, 0.5), trt = rbinom(n,1, 0.5), trialref = rep(1:10, n/10) ))
fit.surv.trt0 = fitfrail(Surv(time, status) ~ cov + cluster(trialref),
dat = data[data$trt==sort(unique(data$trt))[1],],
frailty="lognormal")
bb = cbind("fitnormal" = fit.surv.trt0$init.Lambda, fittemps = fit.surv.trt0$Lambda.all$time, temps =c(0,sort(data[data$trt==sort(unique(data$trt))[1],"time"] )))
apply(bb, 2, function(x) sum(is.na(x)))
n= 4000
data = as.data.frame(cbind(time= runif(n, 0.01,20), status = rbinom(n,1, 0.6), cov = rbinom(n,1, 0.5), trt = rbinom(n,1, 0.5), trialref = rep(1:10, n/10) ))
fit.surv.trt0 = fitfrail(Surv(time, status) ~ cov + cluster(trialref),
dat = data[data$trt==sort(unique(data$trt))[1],],
frailty="lognormal")
bb = cbind("fitnormal" = fit.surv.trt0$init.Lambda, fittemps = fit.surv.trt0$Lambda.all$time, temps =c(0,sort(data[data$trt==sort(unique(data$trt))[1],"time"] )))
apply(bb, 2, function(x) sum(is.na(x)))