R/simulate_polytomous.R

#'@name simulate_polytomous
#'@title Polytomous data simulation
#'@description This function generates dichotomous test of an specified dimension and size. The items per dimension are specified in the size.cluster vector, and the individuals are specified in sample.size.
#'The amout of categories of each item is determined with ncatgs.
#'@param dim.data Data dimension
#'@param sample.size Size of the population that will be simulated
#'@param size.cluster Vector containing the number of items by dimension
#'@param ncatgs Vector containing the number of categories for each item
#'@param seed_data Seed for simulation
#'@param model the model used to generate the test. It can have values of "1PL", "2PL" or "3PL".
#'@return list with the simulated data, the information of the item parameters and
#'the individual parameters
#' @seealso
#' \code{\link{simulate_polytomous}}
#'@export 
simulate_polytomous = function(dim.data = 1, sample.size = 1000, size.cluster = c(20), ncatgs = rep(4, 20), seed_data=5000L,model="2PL") {
  if ( dim.data > 1 )
    sim = simulate.poly.multi(sample.size = sample.size, size.cluster = size.cluster, dim.data = dim.data,
                              ncatgs = ncatgs, seed_data = seed_data)  
  else 
    sim = simulate.poly.uni(n = sample.size, nitems = sum(size.cluster), ncatgs = ncatgs, seed_data = seed_data,model=model)
  
  return (sim)
}

Try the LatentREGpp package in your browser

Any scripts or data that you put into this service are public.

LatentREGpp documentation built on April 14, 2017, 11:55 a.m.