-
Notifications
You must be signed in to change notification settings - Fork 4
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
Get imputation values for survival model #3
Comments
Thank you for your post. This is indeed a bug. The wrong elements of the data matrix are set to be monitored. I will look into fixing this. In the meantime, you can "solve" the issue by specifying the correct elements to be monitored via the "other" argument of library("JointAI")
# modelspecification without actually running it
mod0 <- survreg_imp(Surv(futime, status != "alive") ~ age + sex +
copper + trig, models = c(copper = "lognorm", trig = "lognorm"),
data = subset(PBC, day == 0), n.adapt = 0)
# indices of the column and rows of the data matrix containing the variable "copper"
col <- which(colnames(mod0$data_list$M_lvlone) == "copper")
rows <- which(is.na(mod0$data_list$M_lvlone[, "copper"]))
# node to be monitored
imp_copper <- paste0("M_lvlone[", rows, ",", col, "]")
# run the model
mod6a <- update(mod0, n.adapt = 100, n.iter = 250,
monitor_params = list(imps = TRUE, other = imp_copper))
# extract the imputed values
impDF <- get_MIdat(mod6a, m = 10, seed = 2019) |
Thank you! Dr NErler. I am not sure of the meaning of this solution and I would like to use it on my own data with over 300000 rows and 80 columns. Is it possible to use survreg_imp/coxph_imp for multil-class (like in competing risk model) or multi-label classification? Is it possible to training survreg_imp/coxph_imp model and then use this model to impute the missing value for another dataset (like the testing set)? Thank you! |
It is not yet possible to fit competing risk models in JointAI. |
Dear Sir or Madam
I am running the guideline survival models and would like to extract the imputed data. I got a error. Any suggestion? Thanks.
The text was updated successfully, but these errors were encountered: