How to get measures of model fit (AIC, F-statistics) in zelig for multiply imputed data?

三世轮回 提交于 2019-12-11 03:45:08

问题


Following up on an earlier post, I am interested in learning how to get the usual measures of the relative quality of a statistical model in zelig for regression using multiply imputed data (created with Amelia).

require(Zelig)
require(Amelia)
data(freetrade)

#Imputation of missing data
a.out <- amelia(freetrade, m=5, ts="year", cs="country")

# Regression model
z.out <- zelig(polity~tariff+gdp.pc, model="ls", data=a.out$imputations)

summary(z.out)

Model: ls
  Number of multiply imputed data sets: 5 
Combined results:
Call:
lm(formula = formula, weights = weights, model = F, data = data)
Coefficients:
                   Value   Std. Error    t-stat    p-value
(Intercept) 1.6740501340 1.0270535468 1.6299541 0.10342186
tariff      0.0196015092 0.0233789523 0.8384255 0.40234214
gdp.pc      0.0003296261 0.0001844909 1.7866798 0.07409327
For combined results from datasets i to j, use summary(x, subset = i:j).
For separate results, use print(summary(x), subset = i:j).

Question

(1) Does anyone know how to get the values of AIC, F-statistics and the degree of freedoms for MI data?

(2) I found a similar question to which Koskuke Imai replied that one can probably take a simple average of the measures produced by the summaries of the individual datasets. The "probably" makes me a bit suspicious. Any thoughts on this?

Many thanks!!


回答1:


I discussed the question with colleagues and we all agreed to go for the solution suggested by Koskuke.

x1 <- summary(z.out[[1]])
x2 <- summary(z.out[[2]])
x3 <- summary(z.out[[3]])
x4 <- summary(z.out[[4]])
x5 <- summary(z.out[[5]])

#F-statistics
(x1$fstatistic[1]+x1$fstatistic[1]+x3$fstatistic[1]+x4$fstatistic[1]+x5$fstatistic[1])/5

#AIC
(AIC(z.out[[1]])+AIC(z.out[[2]])+AIC(z.out[[3]])+AIC(z.out[[4]])+AIC(z.out[[5]]))/5


来源:https://stackoverflow.com/questions/16694587/how-to-get-measures-of-model-fit-aic-f-statistics-in-zelig-for-multiply-imput

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!