Different number of thesholds

Hi all,

I am running a model on 25 items with different numbers of response options across them. The syntax is as follow:

formula_va_ord_2pl_disc ← bf(
response | thres(gr=item) ~ 1+countrycode:age + (country |i| item) + (1 | id))+
lf(disc ~ 1 + (1|i|item))

This syntax is running ok. However, I would like to have different thresholds across countries, by adding cs() for the country as the :

formula_va_ord_2pl_disc ← bf(
response | thres(gr=item) ~ 1+countrycode:age + (cs(country) |i| item) + (1 | id))+
lf(disc ~ 1 + (1|i|item))

I am getting the following error:

Error in seq_len (nthres):
Argument must convert to a non-negative integer

Any suggestions? Thank you!

1 Like

Hi, sorry for not getting to you earlier.

In brms ordinal models the cumulative family only supports the thres() addition term, but does not support cs (category-specific effects). The cs terms are available only for the acat, cratio and sratio ordinal families. (this follow from how the various forms of ordinal models get defined - see the tutorial by Paul for a good treatment: SAGE Journals: Your gateway to world-class journal research)

Additionally, I think the syntax for a varying category-specific intercept should be cs(country | item)

It appears that brms should have given you a more informative error.

So you either need to have something like | thres(gr=item_country) where item_country is the interaction of item and country or switch to cratio (or other) model and have something like cs((country | item) + item) (I didn’t test this precisely, so if you encounter additional difficulties, feel free to ask for more clarifications).

Best of luck with your model!

Hi, thank you for your reply. I am using acat ordinal family, sorry for not specifying that.

I have used your idea of | thres(gr=item_country) and it provides me an intercept for each country and items have different thresholds as aspected.

However, the cs(country | item) is not working, maybe still not implemented this change according to a previous post of Paul:
Not with the cumulative family due to the order requirements of the thresholds. Other ordinal families support that via adding a (cs(1) | item) . Note that I don’t like the current category specific (cs) syntax for varying effects and might change them to cs(1 | item) at some point.

I am using the following syntax:

formula_va_ord_2pl_disc <- bf(
  response  | thres(gr=country:item) ~ 1+country:age_new + cs(country | item) + (1 | id))+
  lf(disc ~ 1 +  (1|item))

and I am getting the error:

Error in str2lang (x): <text>: 1: 6: Unexpected (s) ')' 1: ~ item)

Thank you for your help!

sorry I dropped the ball on this.

I see a few problems - thres is AFAIK not supported for an acat model. Additionally as per help for brmsformula, a category-specific varying intercept should be specified as (cs(country) | item), i.e. the grouping should not be part of the cs term. Unfortunately the error message from brms is not very informative in this case.

Best of luck with your model!