After updating to the newest version of Amelia (1.7.4), I tried
overimputing a dataset that has incorrect values in one of its variables.
All of the error observations are measured identically (as zeros, where
they should be positive). The code I originally used is below, and it
triggers a warning of the type: "Some observations estimated with negative
measurement error variance. Set to gold standard."
dat<-data.frame(A, B, C, VS)
mopd<-moPrep(dat, VS~VS, subset=VS<.0001)
I looked through the github code as to what causes this error (other than,
of course, the negative error variance), and more importantly, how to
activate the gold.standard (which for my purposes is the rest of the values
for VS) and presumably fix this issue. After trying quite a few different
possible codings, I can't get it to work. I either receive the same error,
or a host of errors surrounding how I've included gold.standard in the
code. I would think it should be easy, since I'm basically bifurcating my
data (all data under some amount is the subset measured with error; all
data over the amount can be considered gold-standard data), but can't
figure it out. Thanks for any help you can give,
Sean
Dear list members,
I would like to analyse a multiply imputed data set with zelig,
but I don't know how to do with the last version of the Zelig package.
For instance, the following code, which runs well using a previous version
of the package (4.2.1 for instance), produces an error with the version
5.0.9:
library("Amelia")
data(freetrade)
amelia.out <- amelia(freetrade, m = 15, ts = "year", cs = "country")
is.list(amelia.out$imputations)
#TRUE
is.data.frame(amelia.out$imputations[[1]])
#TRUE
library("Zelig")
zelig.fit <- zelig(tariff ~ pop + gdp.pc + year + polity, data =
amelia.out$imputations, model = "ls", cite = FALSE)
#Error: data is not a data frame
Could you give me an example to show me how to use the last version
of Zelig?
Thank you very much for your help,
Best,
--
*AUDIGIER Vincent*
Applied Mathematic Department, Agrocampus Ouest
65 rue de Saint-Brieuc, 35042 Rennes Cedex, France
Tel: (+33)2 23 48 54 76
Website: http://vincentaudigier.weebly.com/
Thanks for replying, Sir. For information, I use R version 3.2.2. There are
some steps that I'm doing with Amelia II package and AmeliaView:
1) I have a data (.csv format, you can see production_index.csv) that
contains 2 variable (Date and Production Index). There are 102 observations
that consists of date data from January 2007 to June 2015 and the
production index data for each month.
2) I make a simulation. I replace some data randomly with NA, so there are
88 data of production index and 14 NA data of production index (you can see
production_index_with_miss.csv)
3) I open the Amelia View and then import production_index_with_miss.csv to
the Amelia package. When I click "Impute!", the error log appear, and the
message at the error log is "Amelia Error Code: 13 You cannot set all
variables (or all but one) as ID variables".
4) So I change the date variable into a number from 1 to 102. I re-import
production_index_with_miss.csv to the Amelia package and then click
"Impute!". After that, there are 5 .csv data that contains the impute data.
Am I do right? Or there are something wrong with my steps? Thanks for your
attention.
Kind regards,
Iqbal Hanif