bigIRT-package: The 'bigIRT' package.

bigIRT-packageR Documentation

The 'bigIRT' package.

Description

A DESCRIPTION OF THE PACKAGE

Author(s)

Maintainer: Charles Driver charles.driver@ife.uzh.ch (ORCID)

References

Stan Development Team (NA). RStan: the R interface to Stan. R package version 2.26.1. https://mc-stan.org

Examples

#Generate some data (here 2pl model
require(data.table)
dat <- simIRT(Nsubs = 5000,Nitems = 100,Nscales = 1,
  logitCMean = -10,logitCSD = 0,AMean = 1,ASD = .3,
  BMean=0,BSD = .5,
  AbilityMean = 0,AbilitySD = 1)

#convert to wide for TAM
wdat <- data.frame(dcast(data.table(dat$dat),formula = 'id ~ Item',value.var='score')[,-1])


#fit using TAM
require(TAM)
tfit <-tam.mml.2pl(resp = wdat,est.variance = TRUE)


#fit using bigIRT
fit <- fitIRT(dat$dat,cores=2,pl=2)

#some summary stuff:
plot(dat$Ability,(fit$pars$Ability-dat$Ability)^2) #ability error given ability
sqrt(mean((fit$pars$Ability-dat$Ability)^2)) #rms error stat

#correlations of estimated vs true
cor(data.frame(True=dat$Ability,Est=fit$pars$Ability))
cor(data.frame(True=dat$A,Est=fit$pars$A))
cor(data.frame(True=dat$B,Est=fit$pars$B))


cdriveraus/bigIRT documentation built on Sept. 14, 2024, 5:42 a.m.