automatic.recode: Automatic Method of Finding Keys in a Dataset with Raw Item...

Description Usage Arguments Value Examples

View source: R/automatic.recode.R

Description

This function calculates keys of a dataset with raw item responses. It starts with setting the most frequent category of an item to 1. Then, in each iteration keys are changed such that the highest item discrimination is found.

Usage

1
2
automatic.recode(data, exclude=NULL, pstart.min=0.6, allocate=200,
    maxiter=20, progress=TRUE)

Arguments

data

Dataset with raw item responses

exclude

Vector with categories to be excluded for searching the key

pstart.min

Minimum probability for an initial solution of keys.

allocate

Maximum number of categories per item. This argument is used in the function tam.ctt3 of the TAM package.

maxiter

Maximum number of iterations

progress

A logical which indicates if iteration progress should be displayed

Value

A list with following entries

item.stat

Data frame with item name, p value, item discrimination and the calculated key

data.scored

Scored data frame using calculated keys in item.stat

categ.stats

Data frame with statistics for all categories of all items

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
#############################################################################
# EXAMPLE 1: data.raw1
#############################################################################
data(data.raw1)

# recode data.raw1 and exclude keys 8 and 9 (missing codes) and
# start with initially setting all categories larger than 50 
res1 <- sirt::automatic.recode( data.raw1, exclude=c(8,9), pstart.min=.50 )
# inspect calculated keys
res1$item.stat

#############################################################################
# EXAMPLE 2: data.timssAusTwn from TAM package
#############################################################################

miceadds::library_install("TAM")
data(data.timssAusTwn,package="TAM")
raw.resp <- data.timssAusTwn[,1:11]
res2 <- sirt::automatic.recode( data=raw.resp )

## End(Not run)

alexanderrobitzsch/sirt documentation built on June 27, 2021, 12:03 a.m.