Skip to main content
. 2020 May 6;8(2):21. doi: 10.3390/jintelligence8020021
library(dexter) # load the dexter library
setwd(’~/WD/Raven’) # set the work directory
keys = data.frame( # data frame as required
  item_id = sprintf(’SPM%02d’, 1:12), #   by keys_to_rules function
  noptions = 8,
  key = c(7,6,8,2,1,5,1,6,3,2,4,5) #   (the correct responses)
)
rules = keys_to_rules(keys) # scoring rules as reqd by dexter
db = start_new_project(rules, ’raven.db’) # data base from the rules
dat = read.csv(’dataset.csv’, head=TRUE) # read in data...
add_booklet(db, dat, ’r’) # ... and add to the data base
tia_tables(db) # tables of CTT statistics
mo = fit_inter(db) # fit the Rasch and the IM
plot(mo) # produce all ITR plots
distractor_plot(db,’SPM01’) # distractor plot for item SPM01