cheat: Method to detect excessive similarity in student test...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/cheat.R

Description

Examines all pairwise comparisons within a group to assess the degree to which response patterns between individuals are too similar to have occured from random chance alone.

Usage

1
2
3
4
5
cheat(...)
## Default S3 method:
cheat(dat, key, wrongChoice, alpha = .01, rfa = c('nr', 'uni', 'bsct'), bonf = c('yes','no'), con = 1e-12, lower = 0, upper = 50, ...)
## S3 method for class 'formula'
cheat(formula, data, na.action, subset, key, wrongChoice, ...)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are given under Details.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which cheat is called.

dat

A data frame or matrix with item responses. Implemented only for the default method.

na.action

a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").

subset

an optional vector specifying a subset of observations to be used.

key

a numeric vector containing the correct resposnes to each test item

rfa

the Root Finding Algorithm used. Options include nr for newton-raphson, uni to use R's internal uniroot function, or bsct for the bisection method.

alpha

Level of significance

bonf

Option to choose bonferonni adjustment to the alpha

con

Tolerance for root finding algorithms

lower

the lower end points of the interval to be searched for the bisection and uniroot functions

upper

the upper end points of the interval to be searched for the bisection and uniroot functions

wrongChoice

a list containing the probability of choosing each incorrect response option. See wrongProb for details

...

Not implemented

Details

The dataframe must be organized with examinees as rows and their responses in columns

Value

A list with class "cheat" containing the following components:

Number of Possible Cheatering Pairs

the number of individuals with similar response patterns)

Possible Cheating Pairs

the identified individuals. S28:32 denotes that individuals in rows 28 and 32 have similar response patterns

Number of Exact Matches

Number of observed exact matches between the two individuals compared

Observed Z Values

the statistical result comparing number of observed exact matches to the expected

Critical Z

the z value used as the threshold

Expected Number of Matches

the expected number of matches between the two individuals compared

Author(s)

Harold C. Doran

References

Wesolowsky, G.E (2000). Detecting excessive similarity in answers on multiple choice exams. Journal of Applied Statistics (27)7

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
## Simulate data
NumStu   <- 30
NumItems <- 50
dat <- matrix(0, nrow=NumStu, ncol=NumItems) 
set.seed(1234)
for(i in 1:NumStu){
   dat[i,] <- sample(1:4, NumItems, replace=TRUE)
}
dat <- data.frame(dat)

## Add in explicit answer copying 
dat[(NumStu+1),] <- dat[NumStu,]
dat[(NumStu+2),] <- c(dat[(NumStu-1), 1:25], dat[(NumStu-2), 26:50 ])

## Answer Key
set.seed(1234)
key <- sample(1:4, NumItems, replace=TRUE)

## Formula interface
ff <- as.formula(paste('~', paste( names(dat), collapse= "+")))
## See wrongProb help page
mm <- wrongProb(ff, data = dat, key = key)
(result <- cheat(ff, data = dat, key = key, wrongChoice = mm))
summary(result)

## Default interface
(result <- cheat(dat, key = key, wrongChoice = mm))

wasabi1989/MiscPsycho documentation built on Jan. 19, 2020, 12:29 a.m.