Learn R Programming

TAM (version 1.995-0)

IRTLikelihood.ctt: Computes Individual Likelihood from Classical Test Theory Estimates

Description

Computes individual likelihood from classical test theory estimates under a unidimensional normal distribution of measurement errors.

Usage

IRTLikelihood.ctt(y, errvar, theta = NULL)

Arguments

y
Vector of observed scores
errvar
Vector of error variances
theta
Optional vector for $\theta$ grid.

Value

Object of class IRT.likelihood

Examples

Run this code
#############################################################################
# SIMULATED EXAMPLE 1: Individual likelihood and latent regression in CTT
#############################################################################

set.seed(75)

#--- simulate data
N <- 2000
x1 <- stats::rnorm(N)
x2 <- .7 * x1 + stats::runif(N)
# simulate true score
theta <- 1.2 + .6*x1 + .3 *x2 + stats::rnorm(N, sd = sqrt(.50) )
var(theta)
# simulate measurement error variances
errvar <- stats::runif( N , min = .6 , max = .9 )
# simulate observed scores
y <- theta + stats::rnorm( N , sd = sqrt( errvar) )

#--- create likelihood object
like1 <- IRTLikelihood.ctt( y=y , errvar=errvar , theta = NULL )

#--- estimate latent regression
X <- data.frame(x1,x2)
mod1 <- tam.latreg( like=like1 , Y = X )

## Not run: 
# #--- draw plausible values
# pv1 <- tam.pv( mod1 , normal.approx = TRUE )
# 
# #--- create datalist
# datlist1 <- tampv2datalist( pv1 , pvnames = "thetaPV" , Y=X )
# 
# #--- statistical inference on plausible values using mitools package
# library(mitools)
# datlist1a <- mitools::imputationList(datlist1)
# 
# # fit linear regression and apply Rubin formulas
# mod2 <- with( datlist1a , stats::lm( thetaPV ~ x1 + x2 ) )
# summary( mitools::MIcombine(mod2) )
# ## End(Not run)

Run the code above in your browser using DataLab