I’m working on my master’s thesis using the brms
package, and I have a question about modeling in this context.
My predictor variable is ordinal and measures workload on a 5-point scale. My outcome variable is an ordered categorical variable with 3 categories. The relationship between the workload and the outcome appears to be exponential, with a peak at the midpoint (3 points at workload).
I want to model this relationship but am concerned about how to handle the workload variable in the model. If I treat the workload variable as an ordered factor, the model estimates polynomials of higher orders than 2, which might not be ideal. On the other hand, I prefer not to convert the workload variable into a numeric scale.
Is there a way to model this using brms
that respects the ordinal nature of the outcome variable and accurately captures the non-linear relationship with the workload predictor, without resorting to high-order polynomials?
With this I get higher polynomials as output
test_workload_f ← brm(
formula = category ~ factor(workload) + (1 + factor(workload) || individual + time),
data = sim_data,
family = cumulative(“logit”),
iter = 2000,
chains = 2,
warmup = 500,
cores = parallel::detectCores()
)
I also tried to make the workload score nummeric (but the outcame also dont look the way I want):
sim_data$workload ← as.numeric(sim_data$workload)
formula ← bf(category ~ workload + I(workload^2) + (1 + workload + I(workload^2) || individual + time))
priors ← c(
prior(normal(-1, 1), class = “b”, coef = “IworkloadE2”), # this should be negative
prior(normal(3, 1), class = “b”, coef = “workload”), # The highest point is around workload of 3
prior(normal(1, 1), class = “Intercept”) # This should be positive
)
test_workload_qudratic ← brm(formula,
data = sim_data,
family = cumulative(),
prior = priors, iter = 2000,chains = 2, warmup = 500,
cores = parallel::detectCores()
)
Thanks a lot!