Comments (3)
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 monitor_params
.
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)
from jointai.
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!
from jointai.
It is not yet possible to fit competing risk models in JointAI.
There is no out-of-the-box solution for imputing values in another dataset using the parameter estimates from the first dataset.
Missing values in covariates are imputed from their full-conditional posterior distributions, which are derived within JAGS from the joint distribution that JointAI specifies.
Imputing values in a new dataset based on the parameters from the original data would require you to do this sampling in R, using, for instance, a Metropolis-Hastings sampler because the imputation models will usually not have a closed-form.
from jointai.
Related Issues (15)
- JM_imp(); example for unbalanced longitudinal multinomial logit models HOT 1
- handling a lot of variables at the same time and do purely imputation HOT 1
- It is currently not possible to use “contr.poly” for incomplete categorical covariates. I will use “contr.treatment” instead. You can specify (globally) which types of contrasts are used by changing “options('contrasts')”. HOT 1
- Does JM_imp() have different functional_forms? HOT 2
- JM_imp() for binary longitudinal data and right-censored multistate survival data HOT 1
- Impute specific values? HOT 1
- Error in is.nan(data[, k]) : default method not implemented for type 'list' HOT 1
- could not find function "joint" HOT 3
- there is no package called ‘jointAI’ HOT 1
- current value+slope value in JointAI package? HOT 1
- Error when passing tibble HOT 2
- Could we get the slope or a cumulative effec in JointAI
- JointAI glm_imp() stops working if logistf package is loaded
- Error in 'is.nan().
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jointai.