View source: R/cat_sim_helper_functions.R
get_cat_response_data | R Documentation |
This function extracts the response data from a single
cat_output
object or a list of cat_output
objects and returns
a Response_set
object that contains the administered items of each
simulee or a matrix or responses.
If cd
, cat design, object is given, then the item pool in the
cd
will be used.
get_cat_response_data( cat_sim_output, cd = NULL, output_type = c("Response_set", "matrix"), remove_na = FALSE, attach_summary = FALSE )
cat_sim_output |
This is a list object containing elements that are
|
cd |
A |
output_type |
A string that specifies the output type. Available
options are |
remove_na |
If |
attach_summary |
If |
Depending on the output_type
, the function returns the
response matrix of adaptive tests. If the input is a list of
cat_output
, then the rows will represent examinees
and columns will represent items.
Emre Gonulates
cat_sim
n <- 40 # number of items ip <- generate_ip(n = n) cd <- create_cat_design(ip = ip, next_item_rule = 'mfi', termination_rule = 'max_item', termination_par = list(max_item = 10)) cat_data <- cat_sim(true_ability = rnorm(10), cd = cd) resp_set <- get_cat_response_data(cat_sim_output = cat_data, cd) resp_set # Get the examinee_id of third simulee: resp_set[[3]]$examinee_id # Extract the true theta of the third examinee: resp_set[[3]]$true_ability # Extract the final estimated theta of the third examinee: resp_set[[3]]$est_ability # Extract the final standard error of the third examinee: resp_set[[3]]$se # Alternatively, output can be a matrix: resp_matrix <- get_cat_response_data(cat_sim_output = cat_data, output_type = "matrix") resp_matrix # If cat design provided, the matrix columns will be sorted as the # item pool used for the simulation: resp_matrix <- get_cat_response_data(cat_sim_output = cat_data, cd = cd, output_type = "matrix") resp_matrix # Additionally, remove the colums which has all NA values: resp_matrix <- get_cat_response_data(cat_sim_output = cat_data, cd = cd, remove_na = TRUE, output_type = "matrix") resp_matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.