Missing Data The freetrade data frame from the Amelia package has economic and p
ID: 3069802 • Letter: M
Question
Missing Data The freetrade data frame from the Amelia package has economic and political data on nine developing countries in Asia from 1980 to 1999. The 9 variables include year, country, average tariff rates, Polity IV score, total population, gross domestic product per capita, gross international reserves, a "dummy variable for if the country had signed an IMF agreement in that year, a measure of financial openness, and a measure of US hegemony. Unfortunately, this data has missing values. (a) Explore the "missingness" in the freetrade using your choice of methods, e.g. from packages VIM mice, Amelia, and/or others. (b) Implement your own statistical test (e.g. ANOVA, t-test, chi-square, etc.) to determine if the miss ingness in the tariff variable is independent with the country variable. Does your answer change if you remove Nepal or if you remove the Philippines? Discuss why. (Note: a short description of using the chi-square goodness of fit test is available in the course website.)Explanation / Answer
To get confidence intervals and degrees of freedom for your estimates you can use mitools:
This will give you confidence intervals and proportion of the total variance that is attributable to the missing data:
Of course you can just combine the interesting results into one object:
After some playing around, I have found a more flexible way to get all necessary information using the mice-package. For this to work, you'll need to modify the package's as.mids()-function. Use Gerko's version posted in my follow-up question:
With this defined, you can go on to analyze the imputed data sets:
This will give you all results you get using Zelig and mitools and more:
Note, using pool() you can also calculate pp-values with dfdf adjusted for small samples by omitting the method-parameter. What is even better, you can now also calculate R2R2 and compare nested models: