if (FALSE) { # requireNamespace("Amelia", quietly = TRUE)
data("africa", package = "Amelia")
# Multiple imputation using Amelia
a.out <- Amelia::amelia(x = africa, m = 10,
cs = "country",
ts = "year", logs = "gdp_pc",
p2s = 0)
fits <- with(a.out, lm(gdp_pc ~ infl * trade))
# Simulate coefficients
s <- misim(fits)
s
}
Run the code above in your browser using DataLab