| cheat {MiscPsycho} | R Documentation |
Examines all pairwise comparisons within a class to assess the degree to which student responses are similar enough to suggest possible cheating
cheat(dat, key, alpha = 0.01, bonf = c("yes", "no"), con = 1e-05)
dat |
A dataframe containing the student raw responses to each test items |
key |
Answer Key |
alpha |
Level of significance |
bonf |
Option to choose bonferonni adjustment |
con |
Tolerance for Newton-Raphson iterations |
The dataframe must be organized with students as columns and items as the rows
Harold C. Doran
Wesolowsky, G.E (2000). Detecting excessive similarity in answers on multiple choice exams. Journal of Applied Statistics (27)7
## Simulate data
NumStu <- 30
NumItems <- 50
dat <- matrix(0, ncol=NumStu, nrow=NumItems)
for(i in 1:NumStu){
dat[,i] <- sample(1:4, NumItems, replace=TRUE)
}
dat <- data.frame(dat)
## Add in explicit answer copying
dat[, (NumStu+1)] <- dat[, NumStu]
dat[, (NumStu+2)] <- c(dat[1:25, (NumStu-1)], dat[26:50, (NumStu-2)])
## Answer Key
key <- sample(1:4, NumItems, replace=TRUE)
## Test function
cheat(dat, key)