Note that there are some explanatory texts on larger screens.

plurals
  1. POdegrees of freedom, t-statistic, and f-values of combined multiply imputed data
    primarykey
    data
    text
    <p>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. </p> <p>First, I loaded Amelia and Zelig:</p> <pre><code>require(Amelia) require(Zelig) </code></pre> <p>Then, I loaded the sample data that came with Amelia:</p> <pre><code>data(freetrade) </code></pre> <p>I created 5 imputations for this dataset using the amelia function. </p> <pre><code>a.out &lt;- amelia(freetrade, m = 5, ts = "year", cs = "country") </code></pre> <p>Then, to combine imputations, I used the zelig function:</p> <pre><code>z.out.imp &lt;- zelig(tariff ~ polity + pop + gdp.pc + year + country, data = a.out$imputations, model = "ls" ) </code></pre> <p>However, I got coefficients that appeared to be coefficients of individual imputations, and not those of the combined set when I used this code:</p> <pre><code>summary(z.out.imp) </code></pre> <p>They were as follows:</p> <pre><code>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 </code></pre> <p>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 <a href="http://cran.r-project.org/web/packages/Amelia/vignettes/amelia.pdf" rel="nofollow">http://cran.r-project.org/web/packages/Amelia/vignettes/amelia.pdf</a>)</p> <pre><code>Complete DF = 167 DF: min = 10.36 avg = 18.81 max = 37.62 F( 2, 10.4) = 15.50 Prob &gt; 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 </code></pre> <p>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. </p> <p>The Amelia manual provides this code:</p> <pre><code>&gt; b.out &lt;-NULL &gt; se.out &lt;-NULL &gt; for(i in 1:a.out$m){ + ols.out &lt;- lm(tariff ~ polity + pop + gdp.pc, data = a.out$imputations[[i]]) + b.out &lt;- rbind(b.out, ols.out$coef) + se.out &lt;-rbind(se.out, coef(summary(ols.out))[,2]) + } &gt; combined.results&lt;-mi.meld(q=b.out, se = se.out) &gt; combined.results </code></pre> <p>I tried using it. The returned results are very close to the values and standard errors shown on page 46:</p> <pre><code>$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 </code></pre> <p>However, they do not include the t-statistic, degrees of freedom, or f-values. </p> <p>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?</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload