I'm plotting the effects of ordered logistic regression using sjplot plot_model function.
The code for fitting the model:
mult_4_rank_best <- polr(SpRank ~ RodentRank + SpName + day_start_scale + Lat_scale +
Lon2_scale + Lon_scale + RodentRank:SpName +
day_start_scale:SpName + Lon2_scale:SpName +
Lon_scale:SpName + RodentRank:SpName:day_start_scale,
data = data_mult,
na.action = na.pass,
Hess = TRUE)
Despite there are a lot of predictors, I want to see the effects of Rodent Rank and SpName on the outcome and use this code:
plot_model(mult_4_rank_best, type = "eff", terms = c("RodentRank", "SpName"))
Despite the fact that the variables in the dataset were ordered that way before fitting the model
data_mult$RodentRank <- factor(data_mult$RodentRank,
levels = c("low", "average", "high"),
ordered=TRUE)
I keep getting an outcome picture where the levels of RodentRank
are in alphabetic order. The order.terms = c()
does not help.
I could not google the answer to this problem. If somebody has a clue of how to manage with it I would be very grateful.