Problem with updating terms in the multinom function

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Problem with updating terms in the multinom function

Chao Liu
Dear R-help,

I am trying to add1() all interaction terms on top of a multinomial
baseline model using multinom() but it shows the error

"trying + x1:x2
Error in if (trace) { : argument is not interpretable as logical
Called from: nnet.default(X, Y, w, mask = mask, size = 0, skip = TRUE,
softmax = TRUE, censored = censored, rang = 0, ...)"

What is the problem here? I appreciate any input. Here is a reproducible

data <- data.frame(y=sample(1:3, 24, replace = TRUE),
        x1 = c(rep(1,12), rep(2,12)),
        x2 = rep(c(rep(1,4), rep(2,4), rep(3,4)),2),
        z1 = sample(1:10, 24, replace = TRUE))
m0 <- multinom(y ~ x1 + x2 + x3 + z1, data = data)
m1 <- add1(m0, scope = .~. + .^2, test="Chisq")

My end goal is to see which terms are appropriate to drop by later adding
the line: m1[order(add1.m1$'Pr(>Chi)'),].



        [[alternative HTML version deleted]]

[hidden email] mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.