Cannot specify `disc` in ordinal 2PL model: variable `disc` cannot be found in the data

I am trying to create a 2PL IRT model for some ordinal response scale data and have been trying to implement something similar to what @paul.buerkner suggested in this thread.

The data consist of evaluations completed by individuals at different events and the evaluation has been designed to assess 5 Factors/constructs. The Factors/constructs are comprised of 2-5 of 14 total questions in the evaluation.

I have tried to specify the model with nonlinear syntax as follows:

fmla <- bf(
        Response ~  disc * eta,
                   nl = TRUE,
        disc ~ (1|i|Question),
        eta ~ (1|i|Question) + (0 + Factor|p|Event_ID:ID),
        family = cumulative())

But, when I run get_prior I receive an error

Error: The following variables are missing in 'data':
'disc'

disc isn’t in the data, it should be an estimated parameter, so I’m not sure how to correct my syntax.

If I change the case to Disc I can get possible priors, but I also get two parameters one for disc and one for Disc - along with really low ESS on the Disc parameter.

Can anyone suggest where I’m going wrong in the specification?

Does this work?

bf(Response ~ disc * eta, nl = TRUE) + lf(disc ~ 0 1|i|Question)

Here’s more information: Understanding the disc parameter in ordered logit models

Unfortunately, I get the same error using the additive syntax:

fmla <- bf(
        Response ~  disc * eta,
                   nl = TRUE) +
        lf(disc ~ (1|i|Question)) +
        lf(eta ~ (1|i|Question) + (0 + Factor|p|Event_ID:ID))

priors_list <- get_prior(fmla,
                              Data,
                              family = cumulative())

Error: The following variables are missing in 'data': 'disc'

Did you read the solution to the question I posted above, i.e., Paul’s reply?

Yes, I did read Paul’s answer.

I get the same error if I add cmc = FALSE to the lf for disc.

Here is a reproducible example

Create some data

# List required packages
Pkgs <- c("tidyverse", 
          "brms", 
          "rstan",
          "fabricatr")

# Load packages
lapply(Pkgs, require, c = T)

# Create data with spaces in grouping variable 
df <- fabricate(
        N = 100,
        Subj_ID = rep(1:10, 10),
        Event_ID = rep(rep(LETTERS[1:5], each = 2),10),
        latent = draw_normal_icc(mean = 0, N = N, clusters = Subj_ID, ICC = 0.7),        
        Q1 = draw_likert(x = latent, type = 7),
        Q2 = draw_likert(x = latent + 0.25, type = 7),
        Q3 = draw_likert(x = latent - 0.25, type = 7),
        Q4 = draw_likert(x = latent + 0.5, type = 7),
        Q5 = draw_likert(x = latent - 0.5, type = 7),
        Q6 = draw_likert(x = latent + 0.75, type = 7)
) %>%
        select(-ID, -latent) %>%
        pivot_longer(Q1:Q6, names_to = "Question", values_to = "Response") %>%
        mutate(Subj_ID = factor(Subj_ID),
               Event_ID = factor(Event_ID),
               Factor = case_when(
                  Question == "Q1" | Question == "Q2" ~ "1",  
                  Question == "Q3" | Question == "Q4" ~ "2",  
                  Question == "Q5" | Question == "Q6" ~ "3",  
               ),
               Response = factor(Response, ordered = TRUE))
# Model formula
fmla <- bf(
        Response ~  disc * eta,
        nl = TRUE) +
        lf(disc ~ (1|i|Question), cmc = FALSE) +
        lf(eta ~ (1|i|Question) + (0 + Factor|p|Event_ID:Subj_ID))
## Get priors
priors_list <- get_prior(fmla,
                         df,
                         family = cumulative())

Error: The following variables are missing in 'data': 'disc'

This syntax does seem to work, but I’m unsure if it is an analogous model:

# Formula
fmla2 <- bf(Response ~ 1 + (1 |i| Question) + (0 + Factor | Event_ID:Subj_ID), 
                   disc ~ 1 + (1 |i| Question))

# Get list of priors
priors_list <- get_prior(fmla2,
                         df,
                         family = cumulative())

Well according to ? brmsformula

bf(y ~ person + item, disc ~ item)

is valid notation.

OTOH, page 12 here has lots of info:

Thanks! I have read much of Paul’s work.

My question in this particular instance is with regard to parameterization/specification of a 2-parameter logistic (2PL) IRT model to conduct a psychometric evaluation of a scale with polytomous/ordinal responses.

That assumes a linear formula and not an nl?