rmultinomialmuminmulticollinearity

brmultinom brglm2 vifs and dredge dont work


I am fitting a brmultinom now (instead of previous multinom), but I can not get the VIF or dredge function working on the new model. Any advise?

my code is

library(MuMIn)
options(na.action = na.fail)

dat$Sex <- as.factor(dat$Sex)
dat$season <- as.factor(dat$season)
dat$Data.origin <- as.factor(dat$Data.origin)
str(dat$Length)
str(dat$VBT)

#


model2 <- brmultinom(prey_new ~ 
                      Sex +
                      season +
                      Data.origin +
                      Length +
                      VBT,
                    data = dat,type="AS_mean",maxit=999)

where prey_new is a matrix

summary(model2)
dredge_model_multi <- dredge(model2, rank = "AICc")

and then it starts doing it (fixed term is intercept), but then gives an error Fixed term is "(Intercept)" Error in cf[, 2L] : subscript out of bounds

options(na.action = na.omit)
vif(model2, na.rm = T)

Error in if (names(coefficients(mod)[1]) == "(Intercept)") { : argument is of length zero

Previously on the multinom (nnet) I coudl also run a pseudor2 which doesnt run anymore now:

library("DescTools")
# Calculate the R Square
PseudoR2(model2, which = c("CoxSnell","Nagelkerke","McFadden"))

Error in match.arg(type) : 'arg' should be one of “class”, “probs”

Any experiences with this/ tips on how to solve the issues?


Solution

  • So, I fixed it by extracting the model calls through dredge with the multinom model but with evaluate=F and then looping all possible formulas with brmultinom and extracted AICc.