Description Usage Arguments Value Examples
Find sufficient statistics from a data set
1 | get_ss(dat)
|
dat |
Data set with items as columns and examinees as rows. Missing responses should be coded as NA. |
Vector of sufficient statistics
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | set.seed(2524)
diff_1 <- rnorm(10)
diff_2 <- rnorm(10)
N <- 500
th <- MASS::mvrnorm(N, mu = c(0, -1),
Sigma = matrix(c(1, .5 * 2, .5 * 2, 4), nrow = 2))
probs_1 <- 1 / (1 + exp(-outer(th[, 1], diff_1, "-")))
probs_2 <- 1 / (1 + exp(-outer(th[, 2], diff_2, "-")))
probs <- cbind(probs_1, probs_2)
dat <- apply(probs, 2, function(p) as.numeric(p > runif(N)))
get_ss(dat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.