I'm trying to impute values from a dataset using hmisc. I'm following this guide.
Here is a reproducible example of my code:
#Create dataset and add 0.1 NA values randomly
data <- iris
library(missForest)
library(Hmisc)
iris.mis <- prodNA(iris, noNA = 0.1)
#Calculating imputed values with aregImpute
impute_arg <- aregImpute(~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width + Species, data = iris.mis, n.impute = 5)
completeData2 <- impute.transcan(impute_arg, imputation=1, data=iris.mis, list.out=TRUE,pr=FALSE, check=FALSE)
head(completeData2)
#creating a fit model
library(rms)
fmi <- fit.mult.impute(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + Species, ols, impute_arg, data=iris.mis)
My question is: How do I apply this fit model to my data and impute the NA values in my dataset (iris.mis)?
Answers with code snippets would be greatly appreciated.