Hello,
I am trying to combine multiple imputation and sample weights using
Amelia & Zelig's normal.survey model. Example code-snippet:
[[
x <- (dataframe, including weight-variable "weight")
a.out <- amelia(x, m=5, idvars=c("weight"))
a.mi <- mi(imp$imputations)
fit <- zelig(support ~ sex, model="normal.survey", data=a.mi,
weights=~weight)
]]
Unfortunately, I get the error: "Error in svyglm.survey.design(formula
= support ~ sex, design = list(cluster = list( : all variables must
be in design= argument". It does return a fitted model after it prints
the error.
I can use svyglm() directly and imputationList() & MIcombine() from
the mitools package to analyze Amelia's imputed datasets, for the same
formula:
[[
a.mi <- imputationList(a.out$imputations)
d <- svydesign(id=~1, data=a.mi) #passing an ids=~1 parameter to
zelig() does not help
results <- with(d, svyglm(support ~ sex))
MIcombine(results)
]]
But the output is less complete than that of Zelig.
Am I doing something wrong, or is it not possible to use imputed
datasets from Amelia together with sample weights?
salutations,
Maarten
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=zelig
Zelig program information:
http://gking.harvard.edu/zelig/