Structural Mapping for an IRTree Model

Description

Expands a wide-form file of item responses to a long-form file supporting structural mappings among latent variables

Usage

1
exogenize(mat, cmx, items=seq_len(ncol(mat)), endnode, crossitem=NULL)

Arguments

mat

An integer matrix of IRT responses (columns represent items, rows represent respondents)

cmx

The mapping matrix.

items

A numeric vector with the column positions of all items (measurement variables) in mat. Defaults to all columns of mat.

endnode

A factor with the same length as items indicating the latent variable to which the item is attached, and compatible with the mapping matrix.

crossitem

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.

Value

A data frame with columns:

person

a factor identifying the respondent;

item

a factor identifying the items;

exo1 to exoS

dummy variables identifying the internal nodes: these play the same role as exofactor but are necessary when the model must include independent random effects;

endnode

a factor identifying the end nodes and thus the endogeneous latent variables;

crossitem

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;

value

the binary item responses.

Author(s)

Ivailo Partchev

References

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. http://www.jstatsoft.org/v48/c01/.

See Also

dendrify

Examples

1
2
3
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)))