tabliatelle: Distractor Analysis Tables

Description Usage Arguments Value Examples

View source: R/tabliatelle.R

Description

Implementation of the tabular (Andrich and Styles, 2009) approach to assigning a partial credit scoring system to data previously modeled with a dichotomous Rasch model.

Usage

1
tabliatelle(x, ID, Item, K, response_options, eRm.obj)

Arguments

x

A long formatted dataframe.

ID

column name for ID column.

Item

column name for Item column.

K

column name for column containing multiple choice responses.

response_options

An ordered factor object to arrange column order in the distractor table.

eRm.obj

An object of class eRm and model RM. Use 'eRm::RM(score_data)' to create this object.

Value

tabliatelle returns a list of class tabliatelle.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
library(eRm)
library(psketti)

data("FakeData") # load data
# restructure fake data
Fake_Data_scores <- reshape(FakeData[, c("ID", "Item", "X")],
                            timevar = "Item",
                            idvar = "ID",
                            direction = "wide")
# for eRm col names and row names
names(Fake_Data_scores) <- c("ID",
                             paste0("i",
                                    sprintf(fmt  = "%02d", 1:23)))
                                    
row.names(Fake_Data_scores) <- Fake_Data_scores$ID
Fake_Data_scores$ID         <- NULL

fake_rm   <- RM(Fake_Data_scores) # Estimate Rasch model

# Prepare response options factor
r_o <- factor(sort(unique(FakeData$K)),          # input var
              levels = sort(unique(FakeData$K)), # factor levels
              ordered = TRUE)                    # ordered
# tabliatellify
tlt_data <- tabliatelle(x = FakeData,
                        eRm.obj = fake_rm,
                        ID = "ID",
                        Item = "Item",
                        K = "K",
                        response_options = r_o)

tlt_data # output

SBGalvin/psketti documentation built on March 13, 2021, 1:47 p.m.