computeAbility: Calculate latent traits for a given response matrix and item...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function calculates the MLE of latent traits for a given response matrix with rows being examinees and columns being items for given item parameters.

Usage

1
2
computeAbility(respMat, dscrmn = dscrmn, dffclt = dffclt,
		c = rep(0, length(dffclt)), parallel=FALSE)

Arguments

respMat

The response matrix of 0 and 1 with rows being examinees and columns being items.

dscrmn

A vector of item discrimination parameter.

dffclt

A vector of item difficulty parameter.

c

A vector of guessing parameter. Default is set to all 0 indicating no guessing allowed.

parallel

Logical indicating whether to use parallel computing with foreach package as backend.

Details

This function is a wrapper of the thetaEst() function from catR package (Magis, 2012).

Value

A vector of latent trait estimates for each examinee.

Author(s)

Pan Tong ([email protected]), Kevin R Coombes ([email protected])

References

David Magis, Gilles Raiche (2012). Random Generation of Response Patterns under Computerized Adaptive Testing with the R Package catR. Journal of Statistical Software, 48(8), 1-31.

See Also

fitOnSinglePlat, intIRTeasyRun, calculatePermutedScoreByGeneSampling

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
# number of items and number of genes
nSample <- 10
nGene <- 2000
set.seed(1000)
a <- rgamma(nSample, shape=1, scale=1)
b <- rgamma(nSample, shape=1, scale=1)
# true latent traits
theta <- rnorm(nGene, mean=0)

# probability of correct response (P_ij) for gene i in sample j
P <- matrix(NA, nrow=nGene, ncol=nSample)
for(i in 1:nSample){
	P[, i] <- exp(a[i]*(theta-b[i]))/(1+exp(a[i]*(theta-b[i])))
}
# binary matrix
X <- matrix(NA, nrow=nGene, ncol=nSample)
for(i in 1:nSample){
	X[, i] <- rbinom(nGene, size=1, prob=P[, i])
}
# IRT fitting
fit2PL <- fitOnSinglePlat(X, model=3)
dffclt <- coef(fit2PL$fit)[, 'Dffclt']
dscrmn <- coef(fit2PL$fit)[, 'Dscrmn']
# estimated latent trait
score <- computeAbility(X, dffclt=dffclt, dscrmn=dscrmn)

integIRTy documentation built on May 7, 2019, 3 a.m.