# Computes S-X^2 for polytomous items
sX2 <- function(O, E, N, maxTestScore, itemMax) {
sx2 = 0
for (k in (itemMax+1):(maxTestScore-itemMax)) {
for (z in 1:(itemMax+1)) {
sx2 <- sx2 + N[k]*(O[k, z]-E[k, z])^2/E[k, z]
}
}
sx2
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.