-
- amelia.out.k <- amelia(df, m=200, p2s=0, idvars=c('y','ystar','w'))
- mod.amelia.k <- zelig(y.obs~x+z, model='ls', data=amelia.out.k$imputations, cite=FALSE)
- (coefse <- combine_coef_se(mod.amelia.k, messages=FALSE))
- est.x.mi <- coefse['x','Estimate']
- est.x.se <- coefse['x','Std.Error']
- result <- append(result,
- list(Bxy.est.amelia.full = est.x.mi,
+ amelia_result <- list(Bxy.est.amelia.full = NA,
+ Bxy.ci.upper.amelia.full = NA,
+ Bxy.ci.lower.amelia.full = NA,
+ Bzy.est.amelia.full = NA,
+ Bzy.ci.upper.amelia.full = NA,
+ Bzy.ci.lower.amelia.full = NA
+ )
+
+ tryCatch({
+ amelia.out.k <- amelia(df, m=200, p2s=0, idvars=c('y','ystar','w'))
+ mod.amelia.k <- zelig(y.obs~x+z, model='ls', data=amelia.out.k$imputations, cite=FALSE)
+ (coefse <- combine_coef_se(mod.amelia.k, messages=FALSE))
+ est.x.mi <- coefse['x','Estimate']
+ est.x.se <- coefse['x','Std.Error']
+
+ est.z.mi <- coefse['z','Estimate']
+ est.z.se <- coefse['z','Std.Error']
+ amelia_result <- list(Bxy.est.amelia.full = est.x.mi,