I am a novice R user. I installed Zelig version 4.1-3 and Amelia II version 1.7. I am puzzled on how I can obtain the degrees of freedom, t-statistic, and f-values of combined multiply imputed data using R packages and functions.
First, I loaded Amelia and Zelig:
require(Amelia)
require(Zelig)
Then, I loaded the sample data that came with Amelia:
data(freetrade)
I created 5 imputations for this dataset using the amelia function.
a.out <- amelia(freetrade, m = 5, ts = "year", cs = "country")
Then, to combine imputations, I used the zelig function:
z.out.imp <- zelig(tariff ~ polity + pop + gdp.pc + year + country,
data = a.out$imputations, model = "ls" )
However, I got coefficients that appeared to be coefficients of individual imputations, and not those of the combined set when I used this code:
summary(z.out.imp)
They were as follows:
Coefficients:
Value Std. Error t-stat p-value
(Intercept) 2.766176e+03 6.670110e+02 4.1471215 0.0003572868
polity 1.645011e-01 3.078134e-01 0.5344183 0.5938286336
pop -6.079963e-08 6.518429e-08 -0.9327345 0.3774275934
gdp.pc -4.246794e-04 1.945866e-03 -0.2182470 0.8319093062
year -1.335563e+00 3.519513e-01 -3.7947390 0.0009787456
countryIndonesia -7.000319e+01 4.646330e+01 -1.5066343 0.1700377061
countryKorea -8.643855e+01 4.671629e+01 -1.8502870 0.0926657863
countryMalaysia -8.815182e+01 5.389486e+01 -1.6356256 0.1393312364
countryNepal -8.215250e+01 5.475828e+01 -1.5002753 0.1702129176
countryPakistan -4.349869e+01 5.149729e+01 -0.8446791 0.4238033944
countryPhilippines -8.088975e+01 5.320694e+01 -1.5202857 0.1673234716
countrySriLanka -7.668840e+01 5.695485e+01 -1.3464771 0.2161986616
countryThailand -7.400481e+01 5.186395e+01 -1.4269026 0.1903428838
The Amelia manual shows what some of the coefficients for the combined multiply imputed dataset should be although there is no explanation on how to obtain all of them using R (see page 46 of http://cran.r-project.org/web/packages/Amelia/vignettes/amelia.pdf)
Complete DF = 167
DF: min = 10.36
avg = 18.81
max = 37.62
F( 2, 10.4) = 15.50
Prob > F = 0.0008
Value Std. Error t-stat p-value
polity -0.206 0.39 -0.53 0.61
pop -3.21 e-08 8.72e-09 3.68 0.004
gdp.pc -0.0027 0.000644 -4.28 0.000
Intercept 32.7 2.66 12.29 0.000
Because the amelia function uses monte carlo simulations, we can expect small differences between runs. However, the huge difference in the intercept was a clue that the zelig function returned regression statistics for something else than the combined set.
The Amelia manual provides this code:
> b.out <-NULL
> se.out <-NULL
> for(i in 1:a.out$m){
+ ols.out <- lm(tariff ~ polity + pop + gdp.pc, data = a.out$imputations[[i]])
+ b.out <- rbind(b.out, ols.out$coef)
+ se.out <-rbind(se.out, coef(summary(ols.out))[,2])
+ }
> combined.results<-mi.meld(q=b.out, se = se.out)
> combined.results
I tried using it. The returned results are very close to the values and standard errors shown on page 46:
$q.mi
(Intercept) polity pop gdp.pc
[1,] 33.17325 -0.1499587 2.967196e-08 -0.002724229
$se.mi
(Intercept) polity pop gdp.pc
[1,] 2.116721 0.276968 6.061993e-09 0.0006596203
However, they do not include the t-statistic, degrees of freedom, or f-values.
Are there open-source packages or functions available in R so that I can obtain the degrees of freedom, t-statistic, and f-values without having to do manual calculations?
Thanks.