I have been trying to impute a data set using the mice
package using the following code,
my_imp <- mice(train, m=5, method="pmm", maxit=50)
and I got this error:
iter imp variable
*1 1 existence.expectancy.indexError in solve.default(xtx + diag(pen)) :
system is computationally singular: reciprocal condition number = 3.96306e-17*
Here is a sample from my dataframe (dput
). The error probably results from the existence.expectancy.index
column.
structure(list(galactic.year = c(990025L, 990025L, 990025L, 990025L,
990025L), galaxy = c("Large Magellanic Cloud (LMC)", "Camelopardalis B",
"Virgo I", "UGC 8651 (DDO 181)", "Tucana Dwarf"), existence.expectancy.index = c(0.628656922579983,
0.818082166933375, 0.659443179243005, 0.555861648365899, 0.991196351622249
)), class = "data.frame", row.names = c(NA, -5L))
Please give me ideas on how to solve the error.