Learn R Programming

CDM (version 7.4-19)

vcov: Asymptotic Covariance Matrix, Standard Errors and Confidence Intervals

Description

Computes the asymptotic covariance matrix for 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.

Usage

# S3 method for din
vcov(object, extended=FALSE, infomat=FALSE,ind.item.skillprobs=TRUE,
       ind.item=FALSE, diagcov=FALSE, h=.001,…)

# S3 method for din confint(object, parm, level=.95, extended=FALSE, ind.item.skillprobs=TRUE, ind.item=FALSE, diagcov=FALSE, h=.001, … )

IRT.se(object, …)

# S3 method for din IRT.se( object, extended=FALSE, parm=NULL, level=.95, infomat=FALSE, ind.item.skillprobs=TRUE, ind.item=FALSE, diagcov=FALSE, h=.001, ... )

Arguments

object

An object inheriting from class din.

extended

An optional logical indicating whether the covariance matrix should be calculated for an extended set of parameters (estimated and derived parameters).

infomat

An optional logical indicating whether the information matrix instead of the covariance matrix should be the output.

ind.item.skillprobs

Optional logical indicating whether the covariance between item parameters and skill class probabilities are assumed to be zero.

ind.item

Optional logical indicating whether covariances of item parameters between different items are zero.

diagcov

Optional logical indicating whether all covariances between estimated parameters are set to zero.

h

Parameter used for numerical differentiation for computing the derivative of the log-likelihood function.

parm

Vector of parameters. If it is missing, then for all estimated parameters a confidence interval is calculated.

level

Confidence level

Additional arguments to be passed.

Value

coef: A vector of parameters.

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.

References

Paek, I., & Cai, L. (2014). A comparison of item parameter standard error estimation procedures for unidimensional and multidimensional item response theory modeling. Educational and Psychological Measurement, 74(1), 58-76.

See Also

din, coef.din

Examples

Run this code
# NOT RUN {
#############################################################################
# EXAMPLE 1: DINA model sim.dina
#############################################################################

data(sim.dina, package="CDM")
data(sim.qmatrix, package="CDM")

dat <- sim.dina
q.matrix <- sim.qmatrix

#****** Model 1: DINA Model
mod1 <- CDM::din( dat, q.matrix=q.matrix, rule="DINA")
# look into 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 <- CDM::din( dat, q.matrix=q.matrix, 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