paul-buerkner / thurstonianIRT

Fit Thurstonian IRT models in R using Stan, lavaan, or Mplus
GNU General Public License v3.0
31 stars 12 forks source link

using items multiple times across different blocks #43

Closed SamSWebb closed 8 months ago

SamSWebb commented 8 months ago

When using blocks of items with some items repeating in different blocks (never the same block) I get the following error:

'_Error in make_TIRT_data(data = FCdata, blocks = blocks, direction = "larger", : Item variables in different blocks needs to have different names. Use the 'names' argument in 'setblock' to equate item parameters across blocks.'

To reproduce the issue

data("triplets")

blocks <-
  set_block(c("i1", "i2", "i3"), traits = c("t1", "t2", "t3"),
          signs = c(1, 1, 1)) +
  set_block(c("i1", "i4", "i5"), traits = c("t1", "t4", "t4"),
          signs = c(1, 1, 1))

triplets_long <- make_TIRT_data(
  data = triplets, blocks = blocks, direction = "larger",
  format = "pairwise", family = "bernoulli", range = c(0, 1)
)

Please can you further explain how to use data with items that repeat in different blocks please

paul-buerkner commented 8 months ago

You should not use the first argument in set_block with the same name. I.e. don't use i1 in different blocks. Rather, use the names argument to equate them, that is you can use the item names in the "names" argument in different blocks. See example in the aother issue you posted in today.

SamSWebb commented 8 months ago

This does not work either sadly.

If i append a string to items, for instance instead of 'i2', I have 'i2extra' and the name of the item 'i2', this also causes the same error, as well as if I change item and name. Something else is going on and I cannot determine why it wont run with repeated items.

Can the name of the item nor the item include any string of other items in different blocks?

paul-buerkner commented 8 months ago

I need a minimal reproducible example for this to determine what is going on.

SamSWebb commented 8 months ago

sorry, it seems to have righted itself, running identical code.