# An ordinal 2PL model with varying thresholds and discriminations with covariates

Hello friends,
I am working on a research project using multilevel item response modeling through Bayesian inference. I want to explore an ordinal 2PL model with varying thresholds and discriminations. The results of this model should have distinct threshold parameters for each response category within an item and different discrimination parameters across items.
Based on the brms codes of an ordinal 1PL model with varying thresholds and another ordinal 2PL model with varying discriminations in Bürkner’s (2021) paper, 'Bayesian Item Response Modeling in R with arms and Stan,’ I have written the following code for this purpose and obtained some results. However, I am uncertain about the correctness of my approach.

## Fit an ordinal 2PL model with varying thresholds and discriminations

formula_va_ord_thres_2pl ← bf(
resp| thres (gr = item) ~ 1 + (1 |i| item) + (1 | id),
disc ~ 1 + (1 |i| item))

Additionally, I wonder if I should change the prior for the new model based on the ordinal 2PL model with varying discriminations.

## Original weakly informative priors of the ordinal 2PL models with varying discriminations:

prior_va_ord_2pl ←
prior(“constant(1)”, class = “sd”, group = “id”) +
prior(“normal(0, 3)”, class = “sd”, group = “item”) +
prior(“normal(0, 1)”, class = “sd”, group = “item”, dpar = "disc”)

At last, I intend to integrate person-level covariates into the above model. Do you have any recommendations for this? Can I simply include the covariates as follows?

## Use “mode” as a person-level covariate, as indicated in the paper.

formula_va_ord_thres_2pl ← bf(
resp| thres (gr = item) ~ 1 + (1 |i| item) + (1 | id) + mode,
disc ~ 1 + (1 |i| item))

Any help would be much appreciated!