An ordinal logistic regression is not so different from other GLMs. In any other GLM, if you want an interaction between features, you must specify that interaction. The same applies to the ordinal model.
Perhaps check out this simulation to see what happens when you do not include the interaction term vs when you do.
library(rms)
library(ggplot2)
N <- 1000
x <- rnorm(N, 0, 3)
x <- runif(N, -10, 10)
g <- rbinom(N, 1, 0.5)
Ey <- x - 2*x*g
e <- rnorm(N, 0, 1)
y <- Ey + e
d1 <- data.frame(
X = x,
Y = y,
Group = as.factor(g)
)
L_null <- rms::orm(y ~ x + g)
L_full <- rms::orm(y ~ x + g + x*g)
preds_null <- predict(L_null)
preds_full <- predict(L_full)
ggplot(d1, aes(x = X, y = Y, col = Group)) +
geom_point() +
theme(legend.position = "bottom")
d2 <- data.frame(
X = c(x, x),
YHat = c(preds_null, preds_full),
Group = as.factor(c(g, g)),
Model = as.factor(rep(c("Without Interaction", "With Interaction"), c(N, N)))
)
ggplot(d2, aes(x = X, y = YHat, col = Group)) +
geom_point() +
facet_grid(cols = vars(Model)) +
theme(legend.position = "bottom")
Here is a plot of the points, where Y
depends on X
, the group, and the interaction.
The predictions from the model with the interaction explicitly modeled picks up on the interaction. Without the interaction explicitly modeled, the ordinal logistic regression in rms::orm
cannot figure it out on its own.