Learn R Programming

irt (version 0.1.1)

get_cat_response_data: Extracts the response data of CAT output.

Description

This function extracts the response data from a single cat_output object or a list of cat_output objects and gives either a vector (if there is a single cat_output object) or a matrix (if there is a lit of cat_output objects) of response data.

If cd, cat design, object is given, then the item pool in the cd will be used.

Usage

get_cat_response_data(
  cat_sim_output,
  cd = NULL,
  remove_na = FALSE,
  attach_summary = FALSE
)

Arguments

cat_sim_output

This is a list object containing elements that are "cat_output" class.

cd

A cat_design object that is created by function create_cat_design.

remove_na

If TRUE, the columns that are all NA will be removed.

attach_summary

If TRUE, the summary of each CAT will be attached to the beginning of the response string as columns. The default value is FALSE.

Value

This function returns a 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. For single cat_output object the vector names will be the element

See Also

cat_sim

Examples

Run this code
# NOT RUN {
n <- 40 # number of items
ip <- generate_ip(n = n,
                  content = sample(c("Algebra", "Arithmetic", "Geometry"),
                                   n, replace = TRUE))
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)
get_cat_response_data(cat_sim_output = cat_data, cd)

# }

Run the code above in your browser using DataLab