0

I am using the frailtySurv package to obtain estimates of the cumulative hazard of frailty survival data (I know this package was removed from the CRAN a few weeks ago but I really need to use this package). 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?

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)))
Flora Grappelli
  • 659
  • 9
  • 26
  • I don't know why this happens. It doesn't happen with a "gamma" model using `frailtySurv::fitfrail`. The `coxme` package can estimate "lognormal" models. – IRTFM Jul 01 '23 at 18:05

0 Answers0