Learn R Programming

autoFC (version 0.2.0.1002)

get_TIRT_long_data: Convert the TIRT Pairwise/Rank Response Data into Long Format Compatible with the thurstonianIRT Package

Description

To estimate the TIRT model using the thurstonianIRT Package, the pairwise/rank data needs to be converted into long format. Current function serves as that purpose.

Usage

get_TIRT_long_data(
  block_info,
  response_data,
  response_varname,
  format = "pairwise",
  partial = FALSE,
  direction = "larger",
  family = "bernoulli",
  range = c(0, 1),
  block_name = "Block",
  item_name = "ID",
  trait_name = "Factor",
  sign_name = "Reversed"
)

Value

A long format data frame that is compatible with subsequent analyses using the thurstonianIRT package

Arguments

block_info

Information data frame related to keying, dimension, and ID of each item in each block. The order of the rows in block_info need to be consistent with the order of the FC items.

response_data

TIRT pairwise/rank response data.

response_varname

Column names of TIRT pairwise/ranked responses. Can be generated from build_TIRT_var_names().

format, direction, family, range, partial

These parameters works the same as thurstonianIRT::make_TIRT_data().

block_name, item_name, trait_name, sign_name

These parameters indicate the column names in block_info that specify the following information of each item:

block_name: Which block does this item belong to? item_name: What is the name of this item? trait_name: Which trait does this item belong to? sign_name: What is the keying of this item?

Author

Mengtong Li

Details

This function is essentially a wrapper of thurstonianIRT::make_TIRT_data() to allow more functionalities to be incorporated in a single function.

See Also

thurstonianIRT::set_blocks_from_df(), thurstonianIRT::make_TIRT_data()

Examples

Run this code
## See example in convert_to_TIRT_response() for FC_resp
## This example is just for demonstrative purposes showing how the long format data would look like.
if (FALSE) get_TIRT_long_data(block_info = triplet_block_info,
                            response_data = FC_resp[,c(1:15)], 
                            response_varname = build_TIRT_var_names("i", 3, 5, format = "pairwise"),
                            trait_name = "Factor", sign_name = "Keying")

Run the code above in your browser using DataLab