Learn R Programming

DexterMST

DexterMST is an R package acting as a companion to dexter and adding facilities to manage and analyze data from multistage tests (MST). It includes functions for importing and managing test data, assessing and improving the quality of data through basic test and item analysis, and fitting an IRT model, all adapted to the peculiarities of MST designs. DexterMST typically works with project database files saved on disk.

Installation

install.packages('dexterMST')

If you encounter a bug, please post a minimal reproducible example on github. We post news and examples on a blog, it’s also the place for general questions.

Example

Here is an example for a simple two-stage test.

library(dexterMST)
library(dplyr)
# start a project
db = create_mst_project(":memory:")

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)


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:")
add_scoring_rules_mst(db, scoring_rules)

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

We can now plot the design

# plot test designs for all tests in the project
design_plot(db)

We now simulate data:

theta = rnorm(3000)

dat = sim_mst(items, theta, design, routing_rules,'all')
dat$test_id='sim_test'
dat$response=dat$item_score

add_response_data_mst(db, dat)
# IRT, extended nominal response model
f = fit_enorm_mst(db)

head(f)
item_iditem_scorebetaSE_beta
item011-0.90911260.0627456
item021-1.02547860.0629096
item031-0.97403830.0628192
item041-0.85115930.0627179
item051-0.85456610.0627186
item061-0.79666280.0627248
# ability estimates per person
rsp_data = get_responses_mst(db)
abl = ability(rsp_data, parms = f)
head(abl)
booklet_idperson_idbooklet_scoretheta
12411-3.8957687
13610180.6531690
12410014-0.6131689
124100012-0.8930060
12410017-1.6962625
12410029-1.3464286
# ability estimates without item Item01
abl2 = ability(rsp_data, parms = f, item_id != "item01")

# plausible values
pv = plausible_values(rsp_data, parms = f, nPV = 5)
head(pv)
booklet_idperson_idbooklet_scorePV1PV2PV3PV4PV5
12411-2.1173109-2.8452992-1.8224958-2.2535875-2.7653987
12410014-0.9541693-0.3218994-0.5133103-0.7913669-0.6746883
124100012-0.3432901-1.2258409-0.6831306-0.6257580-1.2091710
12410017-1.3945366-1.7253245-1.6556693-1.4768176-1.3666073
12410029-1.2284339-1.0867596-1.2299253-0.3411735-0.9039256
12410034-1.9307668-2.9527556-1.7905466-1.6767628-2.4335210

Copy Link

Version

Install

install.packages('dexterMST')

Monthly Downloads

102

Version

0.9.6

License

LGPL-3

Maintainer

Timo Bechger

Last Published

December 5th, 2023

Functions in dexterMST (0.9.6)

sim_mst

Simulate multistage testing data
plot.DIF_stats_mst

plot method for DIF_mst
dexterMST-package

DexterMST: CML calibration and data management for multi stage tests
plot.im_mst

plots for the interaction model
fit_enorm_mst

Fit the extended nominal response model on MST data
DIF_mst

Exploratory test for Differential Item Functioning
add_response_data_mst

Add multistage response data
close_mst_project

Close an mst project
add_scoring_rules_mst

add scoring rules to an mst project
create_mst_test

Define a new multi stage test
design_plot

Plot the routing design of mst tests
add_person_properties_mst

Add person properties to a mst project
create_mst_project

create a new (empty) mst project
fit_inter_mst

Fit the interaction model on a single multi-stage booklet
mst_rules

Define routing rules
open_mst_project

open an existing mst project
add_item_properties_mst

Add item properties to an dextermst project
alter_scoring_rules_mst

alter scoring rules in an mst project
get_responses_mst

Extract response data from a dexterMST database
profile_tables_mst

Profile analysis
reexports

Objects exported from other packages
get_booklets_mst

retrieve information from a mst database
import_from_dexter

import data from a dexter project