Expands a wide-form file of item responses to a long-form file supporting structural mappings among latent variables
exogenize(mat, cmx, items=seq_len(ncol(mat)), endnode, crossitem=NULL)
An integer matrix of IRT responses (columns represent items, rows represent respondents)
The mapping matrix.
A numeric vector with the column positions of all items
(measurement variables) in mat
. Defaults to all columns of mat
.
A factor with the same length as items
indicating the latent variable to which the item is attached, and
compatible with the mapping matrix.
A factor with the same length as items
indicating the original items that have been crossed with
endnode
(e.g., given at various occasions over time), thus
producing the actual items. This is not meaningful when the design
is nested, and should better be omitted in such cases.
A data frame with columns:
a factor identifying the respondent;
a factor identifying the items;
dummy variables identifying the internal nodes: these play the same role as exofactor
but are necessary when the model must include independent random effects;
a factor identifying the end nodes and thus the endogeneous latent variables;
a factor produced only for crossed designs, identifying the items that are crossed
with endnode
, for example,
in the case when the same items are repeated over time in a longitudinal design;
the binary item responses.
De Boeck, P. and Partchev, I. (2012). IRTrees: Tree-Based Item Response Models of the GLMM Family, Journal of Statistical Software -- Code Snippets, 48(1), 1--28. https://www.jstatsoft.org/v48/c01/.
# NOT RUN {
str(linlatT <- exogenize(linlat,
cbind(c(1,0,0), c(1,1,0), c(0,1,0), c(0,1,1), c(0,0,1)),
endnode = rep(1:3, each=10), cross = rep(1:10, 3)))
# }
Run the code above in your browser using DataLab