Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is an annotated and edited transcript of my attempt to reproduce your problem:</p> <pre><code>&gt; library(Zelig) ZELIG (Versions 4.1-3, built: 2013-01-30) &gt; a.out &lt;- amelia(freetrade, idvars="country", m = 5) Error: could not find function "amelia" </code></pre> <p>The first problem I had is that you did not mention that we need to load the Amelia package. After correcting that I tried again to run the first line:</p> <pre><code>&gt; library(Amelia) ## (Version 1.7, built: 2013-02-10) &gt; a.out &lt;- amelia(freetrade, idvars="country", m = 5) Error in amelia(freetrade, idvars = "country", m = 5) : object 'freetrade' not found </code></pre> <p>This fails because you did not say how to get the freetrade data. Guessing here:</p> <pre><code>&gt; data(freetrade) &gt; a.out &lt;- amelia(freetrade, m = 5) Amelia Error Code: 38 The following variable(s) are characters: country You may have wanted to set this as a ID variable to remove it from the imputation model or as an ordinal or nominal variable to be imputed. Please set it as either and try again. </code></pre> <p>Your example does not work because the <code>amelia</code> function needs to be told what to do with character variables. So I modified your example in order to get one that would actually run:</p> <pre><code>&gt; a.out &lt;- amelia(freetrade, idvars="country", m = 5) &gt; z.out.imp &lt;- zelig(tariff ~ polity + pop + gdp.pc + year + country, + data = a.out$imputations, model = "ls") </code></pre> <p>Running <code>summary</code> on the result gives me the combined model statistics"</p> <pre><code># This part works just fine. &gt; summary(z.out.imp) 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) 3.294715e+03 6.425487e+02 5.1275725 1.330807e-05 polity 2.761343e-01 3.354271e-01 0.8232319 4.145813e-01 pop -6.443769e-08 5.526885e-08 -1.1658953 2.659143e-01 gdp.pc 4.549885e-04 1.354139e-03 0.3359984 7.382138e-01 year -1.599422e+00 3.306932e-01 -4.8365739 2.649602e-05 countryIndonesia -7.396526e+01 4.112206e+01 -1.7986760 1.009329e-01 countryKorea -9.673542e+01 5.036909e+01 -1.9205317 8.713903e-02 countryMalaysia -9.271187e+01 4.998836e+01 -1.8546690 9.424041e-02 countryNepal -8.863525e+01 4.920061e+01 -1.8015072 9.990792e-02 countryPakistan -4.789370e+01 4.362907e+01 -1.0977475 2.960914e-01 countryPhilippines -8.548672e+01 4.662372e+01 -1.8335456 9.533829e-02 countrySriLanka -8.446560e+01 4.939918e+01 -1.7098586 1.170170e-01 countryThailand -8.026702e+01 4.741244e+01 -1.6929529 1.213329e-01 For combined results from datasets i to j, use summary(x, subset = i:j). For separate results, use print(summary(x), subset = i:j). </code></pre> <p>In short, the only thing in your example that works for me is the one thing you claim does not work for you. Please post the code and output showing exactly what you did and exactly what happened, because at the moment I don't have enough information to help solve the problem.</p>
    singulars
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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