Learn R Programming

ItemResponseTrees (version 0.2.5)

irtree_recode: Recode data into pseudoitems

Description

This function takes a data set with polytomous items and an irtree_model and returns the recoded items, the so-called pseudoitems.

Usage

irtree_recode(object = NULL, data = NULL, keep = FALSE)

Arguments

object

Object of class irtree_model. See irtree_model for more information.

data

Data frame containing containing one row per respondent and one column per variable. The variable names must correspond to those used in object.

keep

Logical indicating whether to append the original items to the data frame of the generated pseudoitems

Value

Data frame

Examples

Run this code
# NOT RUN {
m1 <- "
IRT:
t BY x1;
e BY x1;
m BY x1;
Equations:
1 = (1-m)*(1-t)*e
2 = (1-m)*(1-t)*(1-e)
3 = m
4 = (1-m)*t*(1-e)
5 = (1-m)*t*e
Class:
Tree
"
model1 <- irtree_model(m1)
dat <- data.frame(x1 = 1:5)
irtree_recode(model1, dat, keep = TRUE)
# }

Run the code above in your browser using DataLab