Reputation: 71
I would like to impute data for a complex survey design. I have replicate weights (about 50) and a sampling weight. Although I found an example of how to do imputations in R (see below), it has a place for sampling weight (weight=~WTPFQX6
, see a line with “designs” below”) but there is no place for replicate weights. Could you please help me figure it out how to impute data using replicate weights?
library(mitools)
library(RSQLite)
impdata <- imputationList(c("set1","set2","set3","set4","set5"),
dbtype="SQLite", dbname="~/nhanes/imp.db")
designs <- svydesign(id=~SDPPSU6, strat=~SDPSTRA6,
weight=~WTPFQX6, data=impdata, nest=TRUE)
Upvotes: 2
Views: 341
Reputation: 6104
you need to use svrepdesign
not svydesign
for replication-backed designs, and you no longer need to specify the id=
or strat=
parameters, since that information should be contained in the replication weights. the two closest examples to multiply-imputed nhanes on asdfree.com should be
and
but svrepdesign
has a bunch of other parameters that you need to confirm you are using correctly by matching some cdc-published statistic. good luck!
Upvotes: 2