I process missing data using imputation. I am studying Amelia and rms imputation packages. I have several requests regarding these packages.
I want to combine the imputed data sets from Amelia. I saw that Amelia has a function mi.meldthat combines the result of multiple imputation. But I want to combine the data set first, and then prepare another model. I'm not sure what to comb the data set, and then use this data to properly train the model. I want to do this because my test data also lacks data. I want to process it using imputation so that I can use it to predict values.
for(i in 1:impute$m) {
model <- rpart(Y ~X1+X2+X3+X4+X5,
data=impute$imputations[[i]],method="anova",control=rpart.control(cp=0.001))
b.out <- rbind(b.out, model$coef)
se.out <- rbind(se.out, coef(summary(model))[,2])
}
combined.results <- mi.meld(q = b.out, se = se.out)
I also use the rms package for this purpose. I would like to confirm whether the function supports an aregImputeimputed data set?
impute<- aregImpute(Y~X1+X2+X3+X4+X5,data= train_data,n.impute=5,nk=0)
Does anyone have any suggestions on how to combine multiple imputed data sets into one data set?
source
share