make_TIRT_data | R Documentation |
Prepare data for Thurstonian IRT models
make_TIRT_data(
data,
blocks,
direction = c("larger", "smaller"),
format = c("ranks", "pairwise"),
family = "bernoulli",
partial = FALSE,
range = c(0, 1)
)
data |
An object of class |
blocks |
Object of class |
direction |
Indicates if |
format |
Format of the item responses. Either |
family |
Name of assumed the response distribution. Either
|
partial |
A flag to indicate whether partial comparisons are allowed
for responses stored in the |
range |
Numeric vector of length two giving the range of the
responses when using the |
A data.frame
in a specific format and with attributes ready
for use with other functions of the ThurstonianIRT package.
# load the data
data("triplets")
# define the blocks of items
blocks <-
set_block(c("i1", "i2", "i3"), traits = c("t1", "t2", "t3"),
signs = c(1, 1, 1)) +
set_block(c("i4", "i5", "i6"), traits = c("t1", "t2", "t3"),
signs = c(-1, 1, 1)) +
set_block(c("i7", "i8", "i9"), traits = c("t1", "t2", "t3"),
signs = c(1, 1, -1)) +
set_block(c("i10", "i11", "i12"), traits = c("t1", "t2", "t3"),
signs = c(1, -1, 1))
# generate the data to be understood by 'thurstonianIRT'
triplets_long <- make_TIRT_data(
data = triplets, blocks = blocks, direction = "larger",
format = "pairwise", family = "bernoulli", range = c(0, 1)
)
# fit the data using Stan
fit <- fit_TIRT_stan(triplets_long, chains = 1)
print(fit)
predict(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.