# NOT RUN {
set.seed(12345)
# This is an example to rank k responses in a multiple response question
# when the number of respondents is 1000 and the value e is 0.15.
# In this example, we do not use a real data, but generate data in the first six lines.
k <- 3
data <- matrix(NA, nrow = 1000, ncol = k)
for(i in 1:k){
p <- runif(1)
data[, i] <- sample(c(0, 1), 1000, p = c(p, 1-p), replace = TRUE)
}
## or upload the true data
response.number <- 3
prior.parameter <- c(5, 98, 63, 7, 42, 7, 7, 7)
e <- 0.15
rankL2R(data, response.number, prior.parameter, e)
# }
Run the code above in your browser using DataLab