I have some issue, potentially simple but I failed to figure out by far.
So I have a survey design as follows:
design1 = svrepdesign(
weights=~W10,
repweights=W,
data = imputationList(list(imp1, imp2, imp3, imp4, imp5)),
scale = 1,
rscales = rep(1/999,1000),
mse = FALSE,
type = "bootstrap",
combined.weights = TRUE
)
It works perfectly with svyby, svyquantiles etc from the package survey, e.g.:
median_income_by_country = MIcombine(
with(
design1,
svyby(
~income,
~country,
svyquantile,
0.5,
method="constant",
interval.type="quantile",
na.rm = TRUE,
multicore=TRUE
)
)
)
Now I need to calculate the Gini index and other complex survey measurements, e.g., Generalized Entropy and Decomposition (svygei, svygeidec) by using the convey package.
So, I started with the simplest calculation to test, i.e.:
require (convey)
design2 <- convey_prep(design1)
gini.index <- svygini(~income, design = design2)
The last line returns an error:
Error in UseMethod("svygini", design) :
no applicable method for 'svygini' applied to an object of class "c('convey.design', 'svyimputationList')"
Thus my question is how to correct it?