Sometimes it is useful to simulate tests and items in Item Response Theory, this vignette specifies how to simulate tests and use or interpret the output, using the IRTpp package.
To simulate a test use the function simulateTest
as follows
library(IRTpp) test <- simulateTest(model="2PL",items=10,individuals=1000)
This runs a simulation with a 2 parameter logistic model, using 10 items and 1000 individuals. A list is returned with the item parameters, the test (Correct responses of the individuals are marked as a 1, in dichotomic models). For the test we just simulated, item parameters are :
test$itempars
Where test$itempars$a
indicates the parameters belonging to the discrimination parameter, and so on. Notice that the c parameter is a vector of 0, since we are simulating a 2 parameter logistic model.
The test element of the list returned by simulateTest
contain a list of tests generated, notice that if you simulate only one test, the response data will be in :
responses <-test$test responses[1:10,]
responses[1:10,]
are the first 10 rows of the simulated test.
IRTpp has built-in capabilities for simulating multiple tests at once, use the option reps
to simulate multiple tests at once. All the tests are simulated with the same individual and item parameters.
For example simulating 3 tests of the one parameter logistic model :
t = simulateTest(model="1PL",items=4,individuals=5) length(t$test)
Sometimes you want the item parameters to fall in a range, use the boundaries option to achieve this. The boundaries option receives a list of the parameter bounds you want to implement. Let's look at the parameter boundaries in an ordinary 3PL simulated test.
t3 = simulateTest(model="3PL",items=500,individuals=10); summary(t3$itempars$c)
As you can see, the item parameters will most likely fall inside 0 and 0.35 which are the package defaults, however we can impose a lower boundary for the c parameter as follows:
bd = list(c_lower=0.2) t3 = simulateTest(model="3PL",items=500,individuals=10,boundaries=bd); summary(t3$itempars$c)
Notice how the lower boundary has been imposed in the c parameter.
When simulating tests, sometimes, perfect responses by an individual can affect procedures made with the tests themselves, or it is required for the simulation that the individuals do not answer less (or more) than a percent of the items, to impose restrictions in the individual classic scores use the threshold parameter.
t3 = simulateTest(model="3PL",items=10,individuals=100,threshold=0.2);
This threshold ensures that the individuals do not answer less than 20% of the answers or more than 80% of the answers.
response <- t3$test summary(rowSums(response))
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.