irtree_recode: Recode data into pseudoitems

Description Usage Arguments Value Examples

View source: R/generate-data.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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)

ItemResponseTrees documentation built on July 2, 2020, 2:25 a.m.