Item response model in brms with predictors for correlation?

My current code is quite close to some examples in Paul Buerkner’s Item Response Modeling Paper.

My main interest is in the posterior of the correlation between the responses across two different types of items in a cumulative logit model (three-point ordinal response) The following formula code gets me quite far:

formula <- bf(
  score ~ 1 + (1 | item) + (0 + itemtype | rater),
  disc  ~ 1 + (1 | item))

From a model fit with this formula, I can extract the posterior draws of the parameter cor_rater__itemtypeA__itemtypeB. Now, in the next step, I would like to use fixed predictors (i.e., not a latent variable, but covariables like demographics) to model the correlation between item types. Is this possible in brms? As an example, a related question would be: “Is the correlation higher for younger rates?” In pseudo code, I would like to do something like the following:

formula <- bf(
  score ~ 1 + (1 | item) + (0 + itemtype | rater),
  disc  ~ 1 + (1 | item),
  cor ~ age

Obviously, this does not work, since cor is not recognized (and underspecified). Is there a work-around to achieve this?

I have never seen this done in brms, but I might have missed something about brms.

About modeling correlation parameters: this seems pretty uncommon. I once saw it done in an IRT context in this paper, where they used the Fisher r-to-z transformation as a sort of link function.

I am also reminded of this post by @mike-lawrence, which describes difficulties in accurately estimating correlation parameters. That sort of issue would seem to make it more difficult to do what you want to do. If you only had categorical covariates like itemtype, maybe it is possible to estimate a multiple-group IRT model to do something similar to what you want.


Thank you for the thoughts and the reference. I’m surpised it is uncommon, since it seems like a standard interaction/moderation type of question “what is the effect of Z on the association of X and Y”, but with both X [in my case: latent trait measured by itemtype A] and Y [latent trait measured by itemtype B] being measured with error. Maybe my problem is to force this problem into the IRT context?
I would think that it is principle possible to define such a model in Stan, though I am not sure about brms.

Those sorts of questions can often be reframed as interactions. For example, if X, Y, and Z are observed, then a regression like Y ~ X*Z would seem to tell you whether the relationship between X and Y changes with Z. In your context, I wonder whether an interaction between age and itemtype could do something similar.

The problem I am seeing is that a formula with an interaction term like this

  score ~ 1 + (1 | item) + (0 + itemtype * age | rater),
  disc  ~ 1 + (1 | item)

will model the interaction of itemtype and age to vary by rater. But this is a cross-sectional study, so age is constant within rater, which makes the approach a bit non-sensical? There are multiple raters with the same age, but there is only one age per rater.
Taking the interaction out of the (1|rater) term, on the other hand, will not give me a correlation estimate between itemtypes.
You see, I am bit stuck on this one.

I agree that it doesn’t make sense to let age vary by rater. I am wondering more about inclusion of “fixed effects” for a rater covariate, like

score ~ 1 + (1 | item) + (0 + itemtype | rater) + age + age:itemtype

where the last two terms could be viewed as influencing the mean of the rater distribution.