NErler / JointAI

Joint Analysis and Imputation of generalized linear models and linear mixed models with missing values
https://nerler.github.io/JointAI
28 stars 4 forks source link

handling a lot of variables at the same time and do purely imputation #2

Closed YushuShi closed 3 years ago

YushuShi commented 3 years ago

Just have two questions:

  1. Can JointAI package do purely imputation, but no modeling?
  2. I found it has some difficulty handling a large number of covariates? When I give 50 covariates, it's OK, but when I give more than 100, it says Error in vapply(x, fun, FUN.VALUE = character(1L), ..., USE.NAMES = TRUE) : values must be length 1, but FUN(X[[1]]) result is length 2 In addition: Warning messages: 1: In gsub(paste0("^", clean_lhs, "[[ ]]*~"), "~", deparse(x, width.cutoff = 500L)) : argument 'pattern' has length > 1 and only the first element will be used 2: Using formula(x) is deprecated when x is a character vector of length > 1. Consider formula(paste(x, collapse = " ")) instead. 3: Using formula(x) is deprecated when x is a character vector of length > 1. Consider formula(paste(x, collapse = " ")) instead.

Thanks a lot!

NErler commented 3 years ago
  1. You can get multiple imputed datasets from JointAI. To do that, you need to specify the argument monitor_params(imps = TRUE). Then you can use the function get_MIdat().
  2. Theoretically, there is no limit to the number of covariates you can use, but I didn't anticipate such huge formulas and used deparse with the maximum width.cutoff = 500 in several places. I expect that the issue arises because your formula is longer than that. I'll see what I can do about fixing this.