View source: R/generateHelpers.R
genResponses | R Documentation |
Generates response vectors for n
cases to i
items given
known item parameters, person abilities, and (optionally) other inputs.
genResponses(
abilities,
groups = NULL,
itemParams,
BMatrix = 1,
mcarP = 0,
perturbR = NULL
)
abilities |
A person by latent-dimension matrix of abilities. One column per dimension. |
groups |
A vector of factors of the same length as |
itemParams |
A list of item parameters of the structure used in |
BMatrix |
A simplified B-matrix mapping dimensions (columns) to items (rows). Or the integer "1" if items are dichotomous and ability is uni-dimensional. |
mcarP |
A double indicating the proportion of missing data under the MCAR assumption. |
perturbR |
A list of lists, where each element of the list refers to one item and contains a list of elements describing how responses to that item should be perturbed to model misfit. Each element of the list should contain, in order:
|
A matrix, n
cases by i
items, of scored item responses.
simplef()
, browseVignettes("conquestr")
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.