fitOnSinglePlat: Fit IRT model on a single platform

View source: R/fitOnSinglePlat.R

fitOnSinglePlatR Documentation

Fit IRT model on a single platform

Description

This function fits the Item Response Model for one platform. It assumes the user has already dichotomized the data.

Usage

fitOnSinglePlat(data, model = 2, guessing = FALSE,
    sampleIndices = 1:ncol(data), geneIndices = 1:nrow(data), ...)

Arguments

data

A matrix of 0's and 1's with rows being genes (treated as examinees) and columns being samples (treated as items).

model

IRT model. 1-Rasch model where all item discrination are set to 1; 2-all item discrimation are set to be equal but not necessarily as 1; 3-the 2PL model where no constraint is put on the item difficulty and discrimination parameter.

guessing

A logical variable indicating whether to include guessing parameter in the model.

sampleIndices

Indices of the samples to be feeded into the model. Default is set to use all samples.

geneIndices

Indices of the genes to be feeded into the model. Default is to use all genes.

...

Additional options available in ltm package. Currently not used in intIRT package.

Value

A list giving the estimated IRT model and related information

fit

An object returned by calling ltm package. Item parameters and other auxillary inforamtion (i.e. loglikelihood, convergence, Hessian) can be accessed from this object. For more details, please refer to ltm package

model

The model type

guessing

The guessing parameter

sampleIndices

The sample indices used in the model

geneIndices

The gene indices used in the model

Author(s)

Pan Tong (nickytong@gmail.com), Kevin R Coombes (krc@silicovore.com)

References

Rizopoulos, D. (2006) ltm: An R package for latent variable modelling and item response theory analyses. Journal of Statistical Software, 17(5), 1-25.

See Also

computeAbility, intIRTeasyRun, calculatePermutedScoreByGeneSampling

Examples

# 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)

integIRTy documentation built on May 3, 2022, 9:08 a.m.