Hello,
My question is regarding this recent response from James Honaker to Glenys
Lafrance, pasted below. I'm using AmeliaView, and I received the same error
message for a small data set I'm using (N=126; and 23 variables--one is an
ID string). For some reason, Amelia returns that error when I try to set
one particular dummy variable as "ordinal" in the Step 2 "Variables"
options. All the other transformations I use under the Variables settings
work without error. In other words, if I don't transform the problematic
dummy variable but set all my other transformations, the program runs fine.
One final detail: the variable that is causing my error does not contain any
missing values. In fact, there are only 5 variables in the data set with
any missing values at all, and the degree of missingness is really minor.
So here's my followup question: When I run AmeliaView, should I still use a
transformation for variables even when they contain no missing values? In
reading the first two paragraphs of section 7.2 of the Amelia II manual, I
inferred that one should make these transformations for all variables (even
those with no missing values) because it would help the imputation procedure
to run. Am I reading that correctly?
Thanks,
Paul
Paul Manna
Assistant Professor
Department of Government
Thomas Jefferson Program in Public Policy
College of William and Mary
http://pmanna.people.wm.edu/
tel: 757-221-3024 / fax: 757-221-1868
On Thu, 30 Aug 2007, Glenys Lafrance wrote:
I am trying to set variable options for 41 variables. 25 are ordinal, the
remainder are ID variables. I'm getting the following message:
First off, you might not need to declare variables as ordinal. Generally you
only need to do this for variables that are going to be used in an analysis
model that requires ordinality (like a Logit, Poisson, Ordered Probit, and
the like), and even then, only for the Dependent variable. (Remember,
Nominal variables are another matter, and always need to be declared.) It
might seem unintuitive to allow imputations to have a space that is not the
same as the original data, but if you are rounding the imputations you are
losing information. An imputation of .51 on a dichotomous variable tells you
that in that imputed dataset, the imputation was nearly as likely to be a 1
as a 0. Very few models require right hand side variables to be ordinal,
although it may make graphs look more intuitive.
Anyway, not to deny your question, it seems like something might be wrong in
the way you are setting either the "ords" or "idvars" arguments. We
have a
list of checks to try to catch common errors (and I make most of them
myself, commonly) but there are always interesting ways to define these
arguments in ways that are logically incompatible, that we've yet to think
of. Just check over them one more time. In the latest version of Amelia you
can set them either by using the a vector of the column number, or a vector
of variable names. The latter is less likely to trip you up. This is all
assuming you are using R code of your own, and not using the AmeliaView
interface, which ought not to allow you to do anything you can't do. Let me
know if you don't find your error, or are certain you've set things out
right. We try to write in useful error messages, but whatever event occured
did not trip one.
"error in unsubset(x.orig = prepped$trans.x, x.imp = ximp, blanks =
prepped$blanks, :
subscript out of bounds". Is there something I can do to
proceed.
Also, is there a way to round an imputed data point to the closest observed
value? Thanks in advance,
There is not something built in to do this, although declaring variables as
Ordinal will make certain that the imputations take integer values (if the
original data is integer). But it does not do this by rounding.
regards,
James Honaker
-
Amelia mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive:
http://lists.gking.harvard.edu/?info=amelia