I would like to use the 'mice' library in R to impute data from a clinical trial, in which I have two groups (i.e. var="group" [0=control; 1=intervention]). I want to impute the missing data separately for each group, using the same imputation model. So, I do not want to use group, as a categorical predictor (0;1) but actually perform separate imputations, ending up with m datasets and each of those containing data from both groups.
I am more familar with stata, where after defining the imputation model I would simply add "by (group)".
Is there an efficient way to do so with 'mice'? Thank you.