# NOT RUN {
# Mapping matrix for data with three response categories:
(mm <- cbind(cat = 0:2,
p1 = c(0, 1, 1),
p2 = c(NA, 0, 1)))
#> cat p1 p2
#> [1,] 0 0 NA
#> [2,] 1 1 0
#> [3,] 2 1 1
irtree_create_template(data.frame(x1 = 0:2, x2 = 0:2),
mapping_matrix = mm)
#>
#> m1 <- "
#> Equations:
#> 0 = (1-p1)
#> 1 = p1*(1-p2)
#> 2 = p1*p2
#>
#> IRT:
#> p1 BY x1@1, x2@1;
#> p2 BY x1@1, x2@1;
#>
#> Class:
#> Tree
#> "
#>
# }
Run the code above in your browser using DataLab