## Not run:
# # IMPORT DATA FROM FORMSCANNER
# # in this example
# # the identification number is in column "File name"
# # and the key is given in a separate file
# data(mchoice1)
# data(key)
# # NOTE: the following line creates a file with the same format of FormScanner
# write.csv2(mchoice1, "mchoice1.csv", row.names = FALSE)
# # NOTE: the following line creates a file with the key
# write.csv2(key, "key.csv", row.names = FALSE)
# fs1 <- read.formscanner(file = "mchoice1.csv", keyfile = "key.csv", id = "File.name")
# head(fs1$data)
# fs1$key
# # fs1 is equal to the data set exam1
# ## End(Not run)
data(exam1)
# CONVERT DATA IN BINARY VARIABLES
exam1bin <- resp2binary(obj = exam1, col = 2:31)
# PERSON STATISTICS
pst <- person.stat(obj = exam1, col = 2:31)
head(pst)
summary(pst$score)
hist(pst$score, main = "Histogram of Scores", xlab = "")
# ITEM STATISTICS
item.stat(obj = exam1, col = 2:31)
# FREQUENCIES OF THE RESPONSES
fr <- freq(obj = exam1, col = c("I2","I3"))
fr
plot(fr)
# RESPONSES OF TWO PERSONS
report(obj = exam1, col = 2:31, whichid = c("101844", "101272"))
Run the code above in your browser using DataLab