Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do NAs appear in my survival estimate when I have a large dataset? #9

Open
FloBlue opened this issue Jun 19, 2023 · 0 comments
Open

Comments

@FloBlue
Copy link

FloBlue commented Jun 19, 2023

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)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant