simputation
simputation copied to clipboard
error with using weight variable
when i try the following command
imp_simpuatation<-impute_rhd(
data,
GI~age+sex,
pool = "univariate",
prob = data$SamplingWeight
)
i get the following error:
Error in impute_rhd(data, earnings ~ AG + sex, pool = "univariate", prob = data$SamplingWeight) :
length(prob) != nrow(dat) is not TRUE
I used a debugger function and i think there is a bug in the package which i believe is here:
I believe the highlighted line should be
stopifnot(length(prob) == nrow(dat))
@markvanderloo please see my suggestion above to fix the bug with impute_rhd function
On this note, could it be documented that prob is an optional parameter? Currently, it looks required, which made me get stuck with this issue until I noticed that I don't need to specify weights.