data.ecpe | R Documentation |
ECPE dataset from the Templin and Hoffman (2013) tutorial of specifying cognitive diagnostic models in Mplus.
data(data.ecpe)
The format of the data is a list containing the dichotomous item
response data data
(2922 persons at 28 items)
and the Q-matrix q.matrix
(28 items and 3 skills):
List of 2
$ data :'data.frame':
..$ id : int [1:2922] 1 2 3 4 5 6 7 8 9 10 ...
..$ E1 : int [1:2922] 1 1 1 1 1 1 1 0 1 1 ...
..$ E2 : int [1:2922] 1 1 1 1 1 1 1 1 1 1 ...
..$ E3 : int [1:2922] 1 1 1 1 1 1 1 1 1 1 ...
..$ E4 : int [1:2922] 0 1 1 1 1 1 1 1 1 1 ...
[...]
..$ E27: int [1:2922] 1 1 1 1 1 1 1 0 1 1 ...
..$ E28: int [1:2922] 1 1 1 1 1 1 1 1 1 1 ...
$ q.matrix:'data.frame':
..$ skill1: int [1:28] 1 0 1 0 0 0 1 0 0 1 ...
..$ skill2: int [1:28] 1 1 0 0 0 0 0 1 0 0 ...
..$ skill3: int [1:28] 0 0 1 1 1 1 1 0 1 0 ...
The skills are
skill1
: Morphosyntactic rules
skill2
: Cohesive rules
skill3
: Lexical rules.
The dataset has been used in Templin and Hoffman (2013), and Templin and Bradshaw (2014).
The dataset was downloaded from http://psych.unl.edu/jtemplin/teaching/dcm/dcm12ncme/.
Templin, J., & Bradshaw, L. (2014). Hierarchical diagnostic classification models: A family of models for estimating and testing attribute hierarchies. Psychometrika, 79, 317-339.
Templin, J., & Hoffman, L. (2013). Obtaining diagnostic classification model estimates using Mplus. Educational Measurement: Issues and Practice, 32, 37-50.
GDINA::ecpe
## Not run: data(data.ecpe, package="CDM") dat <- data.ecpe$data[,-1] Q <- data.ecpe$q.matrix #*** Model 1: LCDM model mod1 <- CDM::gdina( dat, q.matrix=Q, link="logit") summary(mod1) #*** Model 2: DINA model mod2 <- CDM::gdina( dat, q.matrix=Q, rule="DINA") summary(mod2) # Model comparison using likelihood ratio test anova(mod1,mod2) ## Model loglike Deviance Npars AIC BIC Chisq df p ## 2 Model 2 -42841.61 85683.23 63 85809.23 86185.97 206.0359 18 0 ## 1 Model 1 -42738.60 85477.19 81 85639.19 86123.57 NA NA NA #*** Model 3: Hierarchical LCDM (HLCDM) | Templin and Bradshaw (2014) # Testing a linear hierarchy hier <- "skill3 > skill2 > skill1" skill.names <- colnames(Q) # define skill space with hierarchy skillspace <- CDM::skillspace.hierarchy( hier, skill.names=skill.names ) skillspace$skillspace.reduced ## skill1 skill2 skill3 ## A000 0 0 0 ## A001 0 0 1 ## A011 0 1 1 ## A111 1 1 1 zeroprob.skillclasses <- skillspace$zeroprob.skillclasses # define user-defined parameters in LCDM: hierarchical LCDM (HLCDM) Mj.user <- mod1$Mj # select items with require two attributes items <- which( rowSums(Q) > 1 ) # modify design matrix for item parameters for (ii in items){ m1 <- Mj.user[[ii]] Mj.user[[ii]][[1]] <- (m1[[1]])[,-2] Mj.user[[ii]][[2]] <- (m1[[2]])[-2] } # estimate model # note that avoid.zeroprobs is set to TRUE to avoid algorithmic instabilities mod3 <- CDM::gdina( dat, q.matrix=Q, link="logit", zeroprob.skillclasses=zeroprob.skillclasses, Mj=Mj.user, avoid.zeroprobs=TRUE ) summary(mod3) #***************************************** #** estimate further models #*** Model 4: RRUM model mod4 <- CDM::gdina( dat, q.matrix=Q, rule="RRUM") summary(mod4) # compare some models IRT.compareModels(mod1, mod2, mod3, mod4 ) #*** Model 5a: GDINA model with identity link mod5a <- CDM::gdina( dat, q.matrix=Q, link="identity") summary(mod5a) #*** Model 5b: GDINA model with logit link mod5b <- CDM::gdina( dat, q.matrix=Q, link="logit") summary(mod5b) #*** Model 5c: GDINA model with log link mod5c <- CDM::gdina( dat, q.matrix=Q, link="log") summary(mod5c) # compare models IRT.compareModels(mod5a, mod5b, mod5c) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.