On Jul 6, 2010, at 2:15 PM, Erik Iverson wrote:




This looks suspiciously like a syntax problem.
I would get my text editor to search for 'c14ordered'
in the code. You might have missed some punctuation.

-Peter Ehlers
A good thought. I checked my own code (the stuff coding the data and using the mi package) and, for good measure, the code of the mi.polr function in the mi package, but the string "c14ordered" never appears.

And what does

>traceback()

tell you?


Here is the original error message:

Error while imputing variable: a8 , model: mi.polr
Error in eval(expr, envir, enclos) : could not find function "c14ordered"

I confess I'm not good at reading traceback() output, but here is what it says:

18: eval(expr, envir, enclos)
17: eval(predvars, data, env)
16: model.frame.default(formula = form, data = data, drop.unused.levels = FALSE)
15: model.frame(formula = form, data = data, drop.unused.levels = FALSE)
14: model.frame(formula = form, data = data, drop.unused.levels = FALSE)
13: eval(expr, envir, enclos)
12: eval(expr, p)
11: eval.parent(m)
10: bayespolr(formula = form, data = data, start = 0, method = c("logistic"),
        drop.unused.levels = FALSE, n.iter = n.iter)
9: mi.polr(formula = "a8 ~ rural_now + a3 + a7 . . . [more arguments here including the rest of the variables in the data set and a list of all the actual data], start = NULL,
       n.iter = 100, draw.from.beta = TRUE)
8: do.call(model.type, args = c(list(formula = info[[CurrentVar]] $imp.formula,
       data = dat, start = if (!is.null(start.val[[i]][[jj]])) {
           start.val[[i]][[jj]]
       } else {
           NULL
       }), info[[CurrentVar]]$params))
7: eval(expr, envir, enclos)
6: eval(substitute(expr), data, enclos = parent.frame())
5: with.default(data = dat, do.call(model.type, args = c(list(formula = info[[CurrentVar]]$imp.formula,
       data = dat, start = if (!is.null(start.val[[i]][[jj]])) {
           start.val[[i]][[jj]]
       } else {
           NULL
       }), info[[CurrentVar]]$params)))
4: with(data = dat, do.call(model.type, args = c(list(formula = info[[CurrentVar]]$imp.formula,
       data = dat, start = if (!is.null(start.val[[i]][[jj]])) {
           start.val[[i]][[jj]]
       } else {
           NULL
       }), info[[CurrentVar]]$params)))
3: .local(object, ...)
2: mi(imp.data, info = info2, n.iter = 10)
1: mi(imp.data, info = info2, n.iter = 10)

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to