create_mst_test {dexterMST} R Documentation

## Define a new multi stage test

### Description

Before you can enter data, dexterMST needs to know the design of your test.

### Usage

create_mst_test(
db,
test_design,
routing_rules,
test_id,
routing = c("all", "last")
)


### Arguments

 db output of open_mst_project or create_mst_project test_design data.frame with columns item_id, module_id, item_position routing_rules output of mst_rules test_id id of the mst test routing all or last routing (see details)

### Details

In dexterMST we use the following terminology:

test

collection of modules and rules to go from one module to the other. A test must have one starting module

booklet

a specific path through a mst test.

module

a block of items that is always administered together. Each item has a specific position in a module.

routing rules

rules to go from one module to another based on score on the current and possibly previous modules

Additionally, there are two possible types of routing:

all

the routing rules are based on the sum of the current and previous modules

last

the routing rules are based only on the current module

The type of routing must be defined for a test as a whole so it is not possible to mix routing types. In CML (as opposed to MML) the routing rules are actually used in the calibration so it is important they are correctly specified. DexterMST includes multiple checks, both when defining the test and when entering data, to make sure your routing rules are valid and your data conform to them.

### Examples

# extended example
# we:
# 1) define an mst design
# 2) simulate mst data
# 3) create a project, enter scoring rules and define the MST test
# 4) do an analysis

library(dplyr)

items = data.frame(item_id=sprintf("item%02i",1:70), item_score=1, delta=sort(runif(70,-1,1)))

design = data.frame(item_id=sprintf("item%02i",1:70),
module_id=rep(c('M4','M2','M5','M1','M6','M3', 'M7'),each=10))

routing_rules = routing_rules = mst_rules(
124 = M1[0:5] --+ M2[0:10] --+ M4,
125 = M1[0:5] --+ M2[11:15] --+ M5,
136 = M1[6:10] --+ M3[6:15] --+ M6,
137 = M1[6:10] --+ M3[16:20] --+ M7)

theta = rnorm(3000)

dat = sim_mst(items, theta, design, routing_rules,'all')
dat$test_id='sim_test' dat$response=dat$item_score scoring_rules = data.frame( item_id = rep(items$item_id,2),
item_score= rep(0:1,each=nrow(items)),
response= rep(0:1,each=nrow(items))) # dummy respons

db = create_mst_project(":memory:")

create_mst_test(db,
test_design = design,
routing_rules = routing_rules,
test_id = 'sim_test',
routing = "all")

design_plot(db)

f = fit_enorm_mst(db)

plot(abl$theta, abl$theta.sim)
cor(abl$theta, abl$theta.sim)