make_item: Creating object representing an item

View source: R/make_item.R

make_itemR Documentation

Creating object representing an item

Description

Function mostly performs checks whether provided arguments are reasonable and match each other.

Usage

make_item(
  scoringMatrix,
  slopes,
  intercepts,
  mode = c("irtree", "gpcm"),
  scoringOnPreviousResponses = NULL,
  editResponse = NULL
)

Arguments

scoringMatrix

a matrix describing how responses (described in rownames of the matrix) map on scores of latent traits (described in columns of the matrix)

slopes

a named numeric vector of slope (discrimination) parameters with names describing latent variables matching each slope (must contain at least all the names occurring in column names of the scoringMatrix but may also contain additional slopes matching latent traits scoring patterns that will be returned by functions provided with arguments scoringOnPreviousResponses or editResponse)

intercepts

a numeric vector of intercept parameters (must be shorter of one than number of rows in the scoringMatrix or the same length but with the first element being 0)

mode

the way the item should be answered - see generate_item_responses_sqn for "irtree" and generate_item_responses_sml for "gpcm"

scoringOnPreviousResponses

an optional function returning a column vector that will be put before first column of the scoringMatrix

editResponse

only if mode='irtree': an optional function returning scoring matrix that should replace that provided by scoringMatrix after response is made at the first node; this should be function accepting two arguments: response - generated response (by the model described with the first column of the scoringMatrix) that is supposed to be edited and scoringMatrix - current scoring matrix (to be replaced)

Value

An object of class rstylesItem representing an item. List of such objects is passed as a test specification to generate_test_responses.


tzoltak/rstyles documentation built on Dec. 4, 2024, 5:16 p.m.