generate_ip: Generate a random 'Itempool' object

View source: R/generate_objects.R

generate_ipR Documentation

Generate a random Itempool object


Generate a random Itempool object


  model = "3PL",
  n = NULL,
  output = "Itempool",
  n_categories = 4,
  se = NULL,



The model of the item pool


The number of items in the item pool.


The type of object returned. The default value is "Itempool".


Return an Itempool-class object.


If n = 1 return an Item-class object. If n > 1, returns a list of Item-class object.


Return a list of item Item-class objects.


For polytomous items, designate the number of categories each item should have. It can be a single integer value larger than 1. In this case all of the polytomous items will have this number of categories. It can be a vector of length n designating the categories of each item. For dichotomous items, the values in n_categories will be ignored.


The values of parameter standard errors for each item, i.e. a list object with elements named as parameter names (excluding "D" parameter).

If the value is TRUE, this function will generate standard error values from a uniform distribution between 0.05 and 0.75 for each parameter of each item.


Additional parameters passed to itempool() function.


An Itempool-class object


Emre Gonulates


# By default, a '3PL' model item pool generated
# Designate the number of items
generate_ip(n = 12)
# Generate item pools for other models
generate_ip(model = "Rasch")
generate_ip(model = "1PL")
generate_ip(model = "2PL")
generate_ip(model = "4PL")
generate_ip(model = "GRM") # Graded Response Model
generate_ip(model = "GPCM") # Generalized Partial Credit Model
generate_ip(model = "PCM") # Partial Credit Model
generate_ip(model = "GPCM2") # Reparameterized GPCM
# Mixture of models
generate_ip(model = c("4PL", "Rasch"))
generate_ip(model = sample(c("4PL", "GPCM"), 12, TRUE))
generate_ip(model = c("2PL", "GRM", "Rasch"), n = 11)

# Generate parameters standard errors for each item
generate_ip(se_paramters = TRUE)

# Generate an item pool consist of testlets and standalone items
temp_list <- list(ids = paste0("testlet-", 1:7), n = c(2, 3, 4, 2, 3, 4, 2))
ip <- itempool(sample(c(
  generate_ip(n = 10, output = "list"),
  sapply(1:length(temp_list$ids), function(i)
    generate_testlet(testlet_id = temp_list$ids[i],
                     n = temp_list$item_models[i],
                     item_id_preamble = paste0("t", i, "-"))))))

irt documentation built on Nov. 10, 2022, 5:50 p.m.