Learn R Programming

CDM (version 4.8-0)

IRT.expectedCounts: S3 Method for Extracting Expected Counts

Description

This S3 method extracts expected counts from model output.

Usage

IRT.expectedCounts(object, ...)

## S3 method for class 'din':
IRT.expectedCounts(object, \dots)

## S3 method for class 'gdina':
IRT.expectedCounts(object, \dots)

## S3 method for class 'mcdina':
IRT.expectedCounts(object, \dots)

## S3 method for class 'gdm':
IRT.expectedCounts(object, \dots)

## S3 method for class 'slca':
IRT.expectedCounts(object, \dots)

Arguments

object
Object of classes din, gdina, mcdina, gdm or
...
More arguments to be passed.

Value

  • An array with expected counts. The dimensions are items, categories, latent classes and groups.

Examples

Run this code
#############################################################################
# EXAMPLE 1: Expected counts gdm function
#############################################################################	

data( data.fraction1 )
dat <- data.fraction1$data
theta.k <- seq( -6 , 6 , len=11 )   # discretized ability

#--- Model 1: Rasch model
mod1 <- gdm( dat , irtmodel="1PL" , theta.k=theta.k , skillspace="normal" ,
               centered.latent=TRUE )              
emod1 <- IRT.expectedCounts(mod1)             
str(emod1)          

#############################################################################
# EXAMPLE 2: Expected counts gdina function
#############################################################################

data(sim.dina)
data(sim.qmatrix)

#--- Model 1: estimation of the GDINA model
mod1 <- gdina( data = sim.dina ,  q.matrix = sim.qmatrix)
summary(mod1)
emod1 <- IRT.expectedCounts( mod1 )
str(emod1)

#--- Model 2: GDINA model with two groups
mod2 <- gdina( data = sim.dina ,  q.matrix = sim.qmatrix , group = rep(1:2, each=200) )
summary(mod2)
emod2 <- IRT.expectedCounts( mod2 )
str(emod2)

Run the code above in your browser using DataLab