sim_resp | R Documentation |
sim_resp
Generate dichotomous (0 or 1) or polytomous responses for
given ability and item parameter.
sim_resp(ip, theta, prop_missing = 0, output = "matrix") ## S4 method for signature 'Item' sim_resp(ip, theta, prop_missing = 0, output = "matrix") ## S4 method for signature 'Testlet' sim_resp(ip, theta, prop_missing = 0, output = "matrix") ## S4 method for signature 'Itempool' sim_resp(ip, theta, prop_missing = 0, output = "matrix") ## S4 method for signature 'numMatDfListChar' sim_resp(ip, theta, prop_missing = 0, output = "matrix")
ip |
An |
theta |
An object containing the subject ability parameters. |
prop_missing |
Proportion of responses that should be missing. Default
value is |
output |
Type of the output. Following options are available:
|
A vector of responses.
Emre Gonulates
## Simulate Responses for an Item object ## item <- generate_item(model = "3PL") sim_resp(ip = item, theta = rnorm(1)) item <- generate_item(model = "GPCM") sim_resp(ip = item, theta = rnorm(1)) item <- generate_item(model = "GRM") sim_resp(ip = item, theta = rnorm(1)) ## Simulate Responses for a Testlet object ## # Create a testlet testlet <- testlet(c(item(b = 1), item(a = .8, b = 3.1), item(b = -1:1, model = "PCM"))) sim_resp(ip = testlet, theta = rnorm(1)) ## Simulate Responses for an Itempool object ## # Create 3PL IRT item parameters ip <- itempool(a = rlnorm(10, 0, 0.3), b = rnorm(10), c = runif(10, 0, .3)) # Simulate responses for one theta: sim_resp(ip = ip, theta = rnorm(1)) # Simulate responses for eight thetas: sim_resp(ip = ip, theta = rnorm(8)) # Create Graded Response Model Parameters ip <- generate_ip(n = 5, model = "GRM", n_categories = c(3, 4, 8, 5, 4)) # Simulate responses for one theta: sim_resp(ip = ip, theta = rnorm(1)) # Simulate responses for 5 thetas: sim_resp(ip = ip, theta = rnorm(5)) # Set 10% of the item responses as missing sim_resp(ip = ip, theta = rnorm(5), prop_missing = .1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.