markvanderloo / simputation

Making imputation easy
GNU General Public License v3.0
91 stars 11 forks source link

impute_rhd fails with "incorrect number of probabilities" when using pool = "multivariate" #39

Open LukasWallrich opened 9 months ago

LukasWallrich commented 9 months ago

I am trying to use impute_rhd with distinct donor sets per missingness patters - but am stuck on this error message that I don't understand. I hope the reprex below helps, and would appreciate any advice how to work around this.

library(simputation)
iris_na <- mice::ampute(iris)
iris_na$amp |> impute_rhd(Sepal.Length + Sepal.Width ~ 1, pool = "multivariate")
#> Error in sample.int(length(x), size, replace, prob): incorrect number of probabilities
x <- iris_na$amp |> impute_rhd(Sepal.Length + Sepal.Width ~ 1)

Created on 2024-02-07 with reprex v2.0.2

markvanderloo commented 8 months ago

Thanks Lukas, we'll pick this up asap.