Description Usage Arguments Value Examples
View source: R/generate-data.R
This function takes a data set with polytomous items and an irtree_model
and returns the recoded items, the so-called pseudoitems.
1 |
object |
Object of class |
data |
Data frame containing containing one row per respondent and one
column per variable. The variable names must correspond to those used in
|
keep |
Logical indicating whether to append the original items to the data frame of the generated pseudoitems |
mapping_matrix |
Matrix of so-called pseudo-items, optional and
overwritten by |
Data frame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 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)
irtree_recode(data = dat,
mapping_matrix = cbind(categ = 1:5,
m = c(0, 0, 1, 0, 0),
t = c(1, 1, NA, 0, 0),
e = c(1, 0, NA, 0, 1)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.