View source: R/extract.deltas.R
extract.deltas | R Documentation |
This function takes as its input a TAM object. It adds reads the TAM item parameters and organizes them into a matrix that can be used as input in the CCCfit
function.
extract.deltas(tamObject)
tamObject |
TAM object containing the results of a a Rasch model or Partial Credit model. |
This function organizes the item parameter results into a matrix where each row is contains the parameters associated with an item and each columns is contains the parameters associated with a specific step (score 0 vs score 1, score 1 vs score 2, etc.). The resulting matrix will have as many rows as items and as many columns as the maximum number of steps among the items.
A matrix in which each row is an item and each column is a step
David Torres Irribarra
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
CCCfit
make.thresholds
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function (tamObject) { delta.long <- tamObject$xsi n.deltas <- apply(tamObject$B, 1, max) delta.mat <- matrix(NA, nrow = length(n.deltas), ncol = max(n.deltas)) matCoords.row <- rep(1:length(n.deltas), n.deltas) matCoords.col <- c() for (i in 1:length(n.deltas)) { for (j in 1:n.deltas[i]) { matCoords.col <- c(matCoords.col, j) } } delta.long$matCoords.row <- matCoords.row delta.long$matCoords.col <- matCoords.col for (k in 1:nrow(delta.long)) { delta.mat[delta.long$matCoords.row[k], delta.long$matCoords.col[k]] <- delta.long$xsi[k] } delta.mat }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.