
Last chance! 50% off unlimited learning
Sale ends in
din
objects. The covariance matrix is computed using the
empirical cross-product approach (see Paek & Cai, 2014).
In addition, an S3 method IRT.se
is defined which produces
an extended output including vcov
and confint
.## S3 method for class 'din':
vcov(object, extended=FALSE, infomat=FALSE ,ind.item.skillprobs=TRUE,
ind.item= FALSE, diagcov = FALSE , h=.001 ,\dots)
## S3 method for class 'din':
confint(object, parm , level=.95 , extended=FALSE,
ind.item.skillprobs=TRUE, ind.item= FALSE, diagcov = FALSE , h=.001 , \dots )
IRT.se(object, ...)
## S3 method for class 'din':
IRT.se( object , extended = FALSE , parm=NULL , level = .95 ,
infomat=FALSE , ind.item.skillprobs = TRUE , ind.item= FALSE ,
diagcov = FALSE , h=.001 , ... )
din
.coef
: A vector of paramters.
vcov
: A covariance matrix. The corresponding coefficients can be extracted
as the attribute coef
from this object.
IRT.se
: A data frame containing coefficients, standard errors
and confidence intervals for all parameters.din
, coef.din
#############################################################################
# EXAMPLE 1: DINA model sim.dina
#############################################################################
data(sim.dina)
data(sim.qmatrix)
dat <- sim.dina
#****** Model 1: (Ordinary) DINA Model
mod1 <- din( dat , q.matr = sim.qmatrix, rule = "DINA")
# look at parameter table of the model
mod1$partable
# covariance matrix
covmat1 <- vcov(mod1 )
# extract coefficients
coef(mod1)
# extract standard errors
sqrt( diag( covmat1))
# compute confidence intervals
confint( mod1 , level=.90 )
# output table with standard errors
IRT.se( mod1 , extended=TRUE )
#****** Model 2: Constrained DINA Model
# fix some slipping parameters
constraint.slip <- cbind( c(2,3,5) , c(.15,.20,.25) )
# set some skill class probabilities to zero
zeroprob.skillclasses <- c(2,4)
# estimate model
mod2 <- din( dat , q.matr = sim.qmatrix, guess.equal=TRUE ,
constraint.slip=constraint.slip, zeroprob.skillclasses=zeroprob.skillclasses)
# parameter table
mod2$partable
# freely estimated coefficients
coef(mod2)
# covariance matrix (estimated parameters)
vmod2a <- vcov(mod2)
sqrt( diag( vmod2a)) # standard errors
colnames( vmod2a )
names( attr( vmod2a , "coef") ) # extract coefficients
# covariance matrix (more parameters, extended=TRUE)
vmod2b <- vcov(mod2 , extended=TRUE)
sqrt( diag( vmod2b))
attr( vmod2b , "coef")
# attach standard errors to parameter table
partable2 <- mod2$partable
partable2 <- partable2[ ! duplicated( partable2$parnames ) , ]
partable2 <- data.frame( partable2 , "se" = sqrt( diag( vmod2b)) )
partable2
# confidence interval for parameter "skill1" which is not in the model
# cannot be calculated!
confint(mod2 , parm= c( "skill1" , "all_guess" ) )
# confidence interval for only some parameters
confint(mod2 , parm=paste0("prob_skill" , 1:3 ) )
# compute only information matrix
infomod2 <- vcov(mod2 , infomat=TRUE)
Run the code above in your browser using DataLab