Hi Xiaobo,
It's hard to know what is going on without seeing the original call to amelia, but I
would definitely check that the variable is indeed numeric by using the following:
is.numeric(mydata[,13])
and check that amelia is also producing numerics:
is.numeric(a.out$imputation[[1]][,13])
What concerns me is that you say that the variable has character labels, which sounds more
like a factor than a numeric.
The error messages point to the variable having no non-missing observations. You can check
how many observations are observed and missing using the following:
sum(!is.na(mydata[,13]))
If this is greater than zero, then there may be a problem with these functions. If so,
please get in touch.
Cheers,
matt.
On Thursday, September 8, 2011 at 1:59 PM, Xiaobo Lu wrote:
Dear all,
I am running into some problems with the newest version of Amelia II and
I cannot figure out exactly why, and I hope you can shed some lights on
these issues that I am running into.
I have successfully imputed 10 dataset by using Amelia II in R. The
imputed datasets look good, so is the overdispersed graph. However, when
I try to run "overimpute" and "compare.density" to conduct more
diagnostics for some specific variables, I am getting the following
error messages:
compare.density(a.out, var =13)
Error in
density.default(vars[!is.na(vars)], na.rm = TRUE) :
argument 'x' must be numeric
overimpute(a.out, var =13)
Error in
segments(xplot[ci.order], lowers[ci.order], xplot[ci.order], :
invalid first argument
I double-check and make sure variable 13 is indeed numeric, but they
have non-English labels.
I have used an older version of Amelia II and imputed a similar dataset
a couple years before, and I have no problem using these diagnostics
commands in R. Now that I have the most up-to-date version of Amelia II
on a new computer, I am running into these problems.
Any suggestions will be greatly appreciated. Thanks a lot in advance.
Best,
X
--
Xiaobo Lü
Assistant Professor
Bush School of Government and Public Service
Texas A&M University
Tel: (979) 845-6510
Fax: (979) 845-4155
Email: xlu(a)bushschool.tamu.edu (mailto:xlu@bushschool.tamu.edu)
Website:
http://www.xiaobolu.com
-
Amelia mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive:
http://lists.gking.harvard.edu/?info=amelia
More info about Amelia:
http://gking.harvard.edu/amelia