Dear Saeid,
Don't take my message in the wrong spirit, but I'll need a little more
information to fully resolve your problem.
Here is a quick simulation of the details you specify (three variables,
two fully observed, one of which is Nominal). You might cut and paste
this code and see if it is giving you the same problems. It runs fine on
my machine:
library(Amelia)
vcv<-matrix(0.1,nrow=3,ncol=3)
vcv[row(vcv)==col(vcv)]<-1
a<-rmvnorm(n=100,mu=c(1,2,3),vcv=vcv) # Simulated Complete Dataset
a[runif(n)>0.9,1]<-NA # MCAR missingness in 1st Column
a[,2]<-round(a[,2]) # Nominal variable in 2nd Column
a[a[,2]>3,2]<-3 # Censor bounds to the Nominal variable
a[a[,2]<0,2]<-0
output<-amelia(a,noms=2) # Run amelia declaring Nominal variable
This runs fine on my machine. Occasionally (1 in 20 imputations maybe)
I'll get the error message:
"The resulting variance matrix was not invertible. Please check your data
for highly collinear variables."
Which occurs when one of the bootstraps of the dataset contains only one
instance of a particular category. If this is the error message you are
getting, this suggests that one of the categories of your Nominal variable
is quite rare, and in some bootstraps, a dummy variable identifying this
category is not identified. Without knowing anything about your dataset,
this might suggest either this rare category needs to be combined with
another category, or an accidental miscoding of the data.
Let me know if you are getting a different error message (in which case,
tell me what error you are getting) or if this sample code does not run on
your system (if your specific application requires a number of libraries,
other than Amelia, load those too before running this simulation, on the
rare chance libraries have shared function names).
This all assumes you are using R directly. If you are using AmeliaView,
either try to give me more specifics about the variables you are using and
the error message you get, or, if you feel comfortable, send me your
dataset and I'll run it from here. (My boilerplate assurance is that I
will not use your dataset for anything other than resolving this problem,
will not distribute or publish from your dataset, and will delete it as
soon as your problem is resolved. However, I know that for some
confidential or proprietary datasets, this is not an option.)
regards,
James Honaker.
On Sun, 18 Feb 2007, saeid_shahraz wrote:
Hi,
I would like to know why Amelia keeps giving me error when I try to impute
missingness in a variable (set to nominal) in a dataset consisting of three
variables (sex set to nominal and age to numerical both without missing
values). I also tried sex and age groups as nominal but it didn't help. I
appreciate your replay to my email.
Thanks
Saeid
Harvard Initiative for Global Health
-
Amelia mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive:
http://lists.gking.harvard.edu/?info=amelia
-
Amelia mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive:
http://lists.gking.harvard.edu/?info=amelia