nerler / jointai Goto Github PK
View Code? Open in Web Editor NEWJoint Analysis and Imputation of generalized linear models and linear mixed models with missing values
Home Page: https://nerler.github.io/JointAI
Joint Analysis and Imputation of generalized linear models and linear mixed models with missing values
Home Page: https://nerler.github.io/JointAI
Dear Dr Nicole Erler
My whole data has over 30,0000 and 884 columns. Now I just sample 1000 rows for testing using using 'survreg_imp' function. Then it has been running for a whole day and never stops, just with 1000 rows data; I also see the warning:
Warning:
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')”.
Here shows the codes:
d<-d[sample(nrow(d), 1000), ]
f<-as.formula(paste('Surv(survival_time,', i,')~',paste(names(d)[!names(d) %in% label_used],collapse='+')))
mod1 <- survreg_imp(f,data = d[!names(d) %in% label_used], n.iter = 250,shrinkage = 'ridge',seed=1,monitor_params = c(analysis_main=TRUE,other_models = TRUE, imps = TRUE))
Could you provide some suggestions?
Hi,
Thank you very much for such great and interesting package!
I have one question, does JM_imp have different functional forms, which are similar with JMBayes2 package?
different functional forms in JMBayes2
Thank you for your time and look forward to hearing more about it. :)
Dear Dr. Erler,
Many thanks for this terrific package.
I wonder if it's possible to impute specific values? For example, a coxph_imp
class that has some missing independent covariate ordered categories clmm
with 4 ordered levels but I'd only want the second & third levels to be imputed, not to impute the reference or the fourth level. Can this be done in the get_MIdat or is it within the _imp function?
Many thanks,
Harry
Hi,
I came across your project and find JM_imp() function that was explained as "joint model for longitudinal and survival data". However, I couldn't execute it on a unbalanced panel data with dependent variable being a 3 categories outcome variable. I appreciate it if you could demonstrate JM_imp() on a similar example (unbalanced longitudinal multinomial logit model).
Thanks.
Erfan
tried install.packages("JointAI")
library(jointAI)
and got the result
there is no package called ‘jointAI’
Dear Dr. Nicole Erler,
I am trying to understand if I can use JM_imp() for my study, which investigates the relationship between a time-varying binary variable (exposure) and right-censored survival outcomes with missing values in the binary variable.
I didn't find an example for binary/categorical time-varying covariates and survival data in this paper https://www.jstatsoft.org/article/view/v100i20. Is it possible to do? In addition, is it possible to use JM_imp() for multistate data as JMbayes2 does?
Thanks a lot!
Xin
Just have two questions:
Thanks a lot!
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.
library(JointAI)
mod6a <- survreg_imp(Surv(futime, status != "alive") ~ age + sex +
copper + trig, models = c(copper = "lognorm", trig = "lognorm"),
data = subset(PBC, day == 0), n.iter = 250,monitor_params = c(analysis_main=TRUE, imp=TRUE))
|| 100%
Warning message:
In readChar(modelfile, file.info(modelfile)$size) :
can only read in bytes in a non-UTF-8 MBCS locale
impDF <- get_MIdat(mod6a, m = 10, seed = 2019)
Error:
I cannot find imputed values for “copper”. Did you monitor them?
mod6b <- coxph_imp(Surv(futime, status != "alive") ~ age + sex +
copper + trig,# models = c(copper = "lognorm", trig = "lognorm"),
data = subset(PBC, day == 0), n.iter = 250,monitor_params = c(analysis_main=TRUE, imp=TRUE))
|| 100%
Warning message:
In readChar(modelfile, file.info(modelfile)$size) :
can only read in bytes in a non-UTF-8 MBCS locale
impDF <- get_MIdat(mod6b, m = 10, seed = 2019)
Error:
I cannot find imputed values for “copper”. Did you monitor them?
Dear Dr. Erler,
I get this error when running the following commands:
model.cox<-coxph_imp(Surv(surv_time,incidenceDM)~BMI_1+ageyr14_1+tg1_1+sbp_1+dbp_1+
fit.lm1<-lme_imp(log(TSH_)~time ,random= ~time | code,data=dataLong,n.iter=200)
Error in is.nan(data[, k]) :
default method not implemented for type 'list'
Many thank you for your guidance,
Alireza
I'm getting the following error when passing a tibble. I'm guessing this is the same problem that was reported in Issue #8.
library(dplyr)
library(JointAI)
set.seed(284397)
lm_imp(y ~ x,
data = tibble(y = rnorm(100),
x = c(rnorm(99), NA)))
## Error in is.nan(data[, k]) :
## default method not implemented for type 'list'
Convert tibbles to data.frames:
lm_imp(y ~ x,
data = tibble(y = rnorm(100),
x = c(rnorm(99), NA)) %>%
as.data.frame())
## Note: No MCMC sample will be created when n.iter is set to 0.
##
## Call:
## lm_imp(formula = y ~ x, data = tibble(y = rnorm(100), x = c(rnorm(99),
## NA)) %>% as.data.frame())
##
## (The object does not contain an MCMC sample.)
Hi,
Thank you very much for such great and interesting package!
Can we have the current value+slope from the JointAI package like the JMbayes2 package?
Thanks
It said could not find the function "joint"
Here is the error:
|.................... | 39% [unnamed-chunk-5] Error in is.nan()
:
! default method not implemented for type 'list'
Backtrace:
<fn>
(...)[<-.tbl_df
(*tmp*
, is.nan(data[, k]), k, value = <lgl>
)Here is the code: lmimp1<- lme_imp(phqtotal~time_25 + treat + treat:time_25 + PHQBL + time_25:PHQBL+nonwhite +(1|id)
+(1|cohort), data =rostlong1r)
Here is the result of lapply for my dataset:
View(rostlong1r)
lapply(rostlong1r, class)
$id
[1] "numeric"
$phqtotal
[1] "numeric"
$time_25
[1] "numeric"
$treat
[1] "numeric"
$PHQBL
[1] "numeric"
$nonwhite
[1] "numeric"
$cohort
[1] "numeric"
Could we get the slope or a cumulative effect in the following way?
(1) run the JM_imp and then get the Imputed data by get_MIdat function
(2) Run the Imputed data in JMBayes2 package
Hi!
Thank you for an excellent package!
I have come across an issue when performing logistic regression with JointAI, and thought to report it since JointAI asks me to report bugs each time I load the package :)
If the logistf package is loaded in Rstudio, the glm_imp function returns the following error: Error in terms.formula(formula) : invalid term in model formula.
The only fix that have worked for me is closing Rstudio completely, restarting and do analyses with JointAI before loading logistf. Detatching logistf or running code as JointAI::glm_imp() did not work.
Best regards,
Silje
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.