xsswang/remiod

Variable type of the treatment variable

Opened this issue · 1 comments

Hello! I am using Remiod for my dissertation project. The data I have got has continuous outcomes with missing values, the aim is to model the data as MAR and MNAR (Delta, J2R and CR). When I include the treatment variable as numeric (coded as 0 for placebo and 1 for treatment), the algorithm works. However, when I include the treatment variable as factor (reference level 0 and treatment level 1), the algorithm said 'Error in MCMC_CR[, mc_imp_col_nam] <- predc : replacement has length zero' when J2R and CR were chosen and the trace plots of the parameters of the treatment variable did not work.

I can see that in the simple example of the 'schizow' data, 'tx' is coded as an integer. Is this an in-built requirement of the package such that categorical treatment variables are not allowed?

Yes. It is a requirement to have the treatment variable coded as interger, which facilitates subsequent manipulations for MNAR imputation. Will consider to allow categorical treatment variable in the future update.

By the way, hope the package can provide the help you need. Please share with me if you have any comment or idea to improve it.
Thanks in advance!