genItems {conquestr}R Documentation

genItems

Description

Generates a list of item parameter matrices for use in function like conquestr::genResponses and conquestr::informationWrightMap

Usage

genItems(n, scores = NULL, deltadots, taus = NULL, discrims = 1)

Arguments

n

How many items?

scores

When NULL it is assumed that all items have integer scoring, increasing for each category k, and beginning from 0. Otherwise a list where the elements are, in order:

  • a string naming a distribution function (for example runif, rnorm) to generate random deviates from (the scores).

  • a list of parameters to pass to the distribution function (for example, for runif, a list of length 2 defining "min" and "max"). This list is assumed to be in order to be directly passed into the function.

  • a boolean indicating whether the scores should be forced to be increasing across the response categories.

  • optionally a vector of item numbers to apply scores too. If not provided it is assumed that all items will be scored.

deltadots

A list where the elements are, in order:

  • a string naming a distribution function (for example runif, rnorm) to generate random deviates from (the delta dots).

  • a list of parameters to pass to the distribution function (for example, for runif, a list of length 2 defining "min" and "max"). This list is assumed to be in order to be directly passed into the function.

taus

When NULL all items are assumed to be dichotomies. Otherwise a list where the elements are, in order:

  • a string naming a distribution function (for example runif, rnorm) to generate random deviates from (the taus). Or the string "manual" to indicate that a user-defined list of the tau parameters will be provided.

  • a list of parameters to pass to the distribution function (for example, for runif, a list of length 2 defining "min" and "max"). This list is assumed to be in order to be directly passed into the function. if the first element in taus is "manual" this should be a list of taus to be used this must be of the correct dimensions - for example, if there are 2 polytomous items being generated, each with 3 response categories (k), then the list should be of length 2: 2 * (k- 2) = 2 * (3 - 2) = 2 taus. This is because there are k-1 taus per item, and the last tau is always constrained to be the negative sum of the rest for identification purposes.

  • a Boolean indicating whether the taus should be forced to be increasing across the response category boundaries (that is, enforce that no item exhibits disordered thresholds).

  • optionally a vector of item numbers to produce taus for. If not provided it is assumed that all items are polytomous.

  • optionally a vector of response categories to apply to each item. For example if the user indicates that 5 items are polytomous, then a vector of length 5 where the first elements describes the count of response categories for the first polytomous item, the second element describes the count of response categories for the second polytomous item, and so on

discrims

When NULL all items are assumed to have constant discrimination equal to 1. Otherwise a list where the elements are, in order:

  • a string naming a distribution function (for example runif, rnorm) to generate random deviates from (the discriminations). Or the string "manual" to indicate that a user-defined list of the discrimination parameters will be provided.

  • a list of parameters to pass to the distribution function (for example, for runif, a list of length 2 defining "min" and "max"). This list is assumed to be in order to be directly passed into the function.

  • a Boolean indicating whether the discriminations are constant within items or whether each response category within an item will have its own score should be forced to be increasing across the response category boundaries (that is, this can be one way of specifying the Bock Nominal model).

  • optionally a vector of items to apply a unique discrimination to. Otherwise it is assumed that all items have unique discriminations.

Value

A list of item matrices.

See Also

simplef(), genResponses(), browseVignettes("conquestr")

Examples

  myItem <- matrix(c(0, 0, 0, 0, 1, 1, 0, 1), ncol = 4, byrow = TRUE)
  myItems <- list(myItem, myItem)
  myItems[[2]][2, 2] <- -1 # make the second item delta equal to -1
  myResponses <- genResponses(abilities = rnorm(100), itemParams = myItems)

[Package conquestr version 1.3.4 Index]