Hello
I am sorry for flooding the list, but that problem really keeps me from
starting the data analysis. Good news: I found out where the error
occurs and what causes it. The bad news: It does not help.
am <-
amelia(mdi,m=5,p2s=2,idvars=ids,noms=noms,ords=ords,collect=FALSE,
+
outname="Routput/imputed", write.out=TRUE,empri=NULL)
amelia starting
Fehler in if (any(unique(na.omit(data[, i]))%%1 != 0)) { :
Fehlender Wert, wo TRUE/FALSE nötig ist
Zusätzlich: Warning message:
'%%' is not meaningful for ordered factors in:
Ops.ordered(unique(na.omit(data[, i])), 1)
The "any(uniqeu(...)" code snippet is located within the "amcheck"
function, around row #462, and it looks like this:
if (!is.null(ords)) {
for (i in ords) {
if (any(unique(na.omit(data[, i]))%%1 != 0)) {
error.code <- 44
error.mess <- paste("You have designated a variable as
ordinal when it has non-integer values.")
return(list(code = error.code, mess = error.mess))
}
}
}
My interpretation: The modulo operator %% is used to check whether the
ords variable contains in fact integer values. So, I tested the relevant
line of code manually with the first ords variable that is passed to
amelia(). It leads to an "NA" and above error message that %% is not
meaningful for ordered factors:
any(unique(na.omit(mdi[,1]))%%1 != 0)
[1] NA
Warning message:
%% nicht sinnvoll für Faktoren in: Ops.factor(unique(na.omit(mdi[, 1])), 1)
BUT the concerned variable looks OK to me:
check(mdi[,1])
Factor w/ 3 levels
"both","free",..: 2 2 3 3 2 1 3 3 1 3 ...
both free open NA's
1032 504 886 19
All values are integers or NA. (I also did this check for some of the
remaining ords variables. The same result.)
Does somebody have an idea what the problem could be? I am grateful for
any hints because else I would have to look for another solution to MI...
Thank you very much!
Kind regards,
Marcus
--
Marcus M. Dapp | PhD student | ETH Zurich |
www.ib.ethz.ch/people/mdapp
Prof. Thomas Bernauer, International Relations |
www.ib.ethz.ch
On the shoulders of giants?
http://science.creativecommons.org
-
Amelia mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive:
http://lists.gking.harvard.edu/?info=amelia