dcminfo: The information matrix for diagnostic classification models...

Description Usage Arguments Value Author(s) References Examples

Description

This function is used to estimate the information matrix for diagnostic classification models (DCMs; Rupp, Templin, & Henson, 2010) or cognitive diagnostic models, such as the the observed information matrix, the empirical cross-product information matrix and the sandwich-type covariance matrix that can be used to estimate the asymptotic covariance matrix or the model parameter standard errors.

Usage

1
2
dcminfo(dat, delta, attr_probs, q_matrix, Mj, Aj, attr_mast_patt = NULL,
  linkfct = "logit", info_type = "Sw")

Arguments

dat

A N \times J binary data matrix consisting of the responses of N examinees to J items.

delta

A list of item parameter estimates.

attr_probs

A vector of the estimated attribute mastery profile probability.

q_matrix

A J \times K matrix (Q-matrix) defines which attributes are measured by which items.

Mj

A list of the design matrices and labels for each item (see de la Torre, 2011).

Aj

A list of the possible combinations of the required attributes for each item (see de la Torre, 2011).

attr_mast_patt

A L \times K binary matrix defines the attribute mastery profiles. see amps.

linkfct

Type of the link function for the DCMs. It can be "logit", "identity", or "log". In the current version, only the "logit" link function is now available.

info_type

The returned information (or covariance) matrix type. The It can be "XPD" (the empirical cross-product information matrix), "Obs"(the observed information matrix), or "Sw" (the sandwich-type covariance matrix). The default is "Sw".

Value

A matrix giving information, or covariance matrix.

Author(s)

Yanlou Liu, Qufu Normal University, liuyanlou@163.com
Tao Xin, Beijing Normal University

References

Liu, Y., Tian, W., & Xin, T. (2016). An Application of M2 Statistic to Evaluate the Fit of Cognitive Diagnostic Models. Journal of Educational and Behavioral Statistics, 41, 3-26.

Liu, Y., Xin, T., Andersson, B. & Tian, W. (2017). Information Matrix Estimation Procedures for Cognitive Diagnostic Models. under review.

de la Torre, J. (2011). The generalized DINA model framework. Psychometrika, 76, 179-199.

Rupp, A. A., Templin, J., & Henson, R. A. (2010). Diagnostic measurement: theory, methods, and applications. New York, NY: Guilford.

Examples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#Example 1.
#The sandwich-type covariance matrix, the empirical cross-product information matrix,
#and the observed information matrix for the DINA model

simresp <- sim_DINA_N1000$simresp
head(simresp)

simdelta <- sim_DINA_N1000$simdelta
simdelta

simqmatrix <- sim_DINA_N1000$simqmatrix
simqmatrix

simAj <- sim_DINA_N1000$simAj
simAj

simMj <- sim_DINA_N1000$simMj
simMj

simAttrProbs <- sim_DINA_N1000$simAttrProbs
simAttrProbs

# The number of the item parameters
N_delta <- length(unlist(simdelta))
N_delta


#Example 1.1 The sandwich-type covariance matrix

Sw_res <- dcminfo(dat=simresp, delta=simdelta, attr_probs=simAttrProbs,
                 q_matrix=simqmatrix, Mj=simMj, Aj=simAj)


Sw_se_delta <- sqrt(diag(Sw_res))[1:N_delta]

Sw_est_delta_se <- data.frame(delta_est= unlist(simdelta), se_delta=Sw_se_delta)
Sw_est_delta_se


#Example 1.2 The empirical cross-product information matrix

XPD_res <- dcminfo(dat=simresp, delta=simdelta, attr_probs=simAttrProbs,
                  q_matrix=simqmatrix, Mj=simMj, Aj=simAj, info_type = "XPD")

# Calculate the covariance matrix of the model parameters based on the XPD matrix
inv_XPD_res <- solve(XPD_res)

XPD_se_delta <- sqrt(diag(inv_XPD_res))[1:N_delta]
XPD_est_delta_se <- data.frame(delta_est= unlist(simdelta), se_delta=XPD_se_delta)
XPD_est_delta_se


#Example 1.3 The observed information matrix

Obs_res <- dcminfo(dat=simresp, delta=simdelta, attr_probs=simAttrProbs,
                  q_matrix=simqmatrix, Mj=simMj, Aj=simAj, info_type = "Obs")

# Calculate the covariance matrix of the model parameters based on the Obs matrix
inv_Obs_res <- solve(Obs_res)

Obs_se_delta <- sqrt(diag(inv_Obs_res))[1:N_delta]
Obs_est_delta_se <- data.frame(delta_est= unlist(simdelta), se_delta=Obs_se_delta)
Obs_est_delta_se


# Example 2.
#The sandwich-type covariance matrix, the empirical cross-product information matrix,
#and the observed information matrix for the C-RUM

simresp <- sim_CRUM_N1000$simresp
head(simresp)

simdelta <- sim_CRUM_N1000$simdelta
simdelta

simqmatrix <- sim_CRUM_N1000$simqmatrix
simqmatrix

simAj <- sim_CRUM_N1000$simAj
simAj

simMj <- sim_CRUM_N1000$simMj
simMj

simAttrProbs <- sim_CRUM_N1000$simAttrProbs
simAttrProbs

# The number of the item parameters
N_delta <- length(unlist(simdelta))
N_delta


#Example 2.1 The sandwich-type covariance matrix

Sw_res <- dcminfo(dat=simresp, delta=simdelta, attr_probs=simAttrProbs,
                 q_matrix=simqmatrix, Mj=simMj, Aj=simAj)


Sw_se_delta <- sqrt(diag(Sw_res))[1:N_delta]

Sw_est_delta_se <- data.frame(delta_est= unlist(simdelta), se_delta=Sw_se_delta)
Sw_est_delta_se


#Example 2.2 The empirical cross-product information matrix

XPD_res <- dcminfo(dat=simresp, delta=simdelta, attr_probs=simAttrProbs,
                  q_matrix=simqmatrix, Mj=simMj, Aj=simAj, info_type = "XPD")

# Calculate the covariance matrix of the model parameters based on the XPD matrix
inv_XPD_res <- solve(XPD_res)

XPD_se_delta <- sqrt(diag(inv_XPD_res))[1:N_delta]
XPD_est_delta_se <- data.frame(delta_est= unlist(simdelta), se_delta=XPD_se_delta)
XPD_est_delta_se


#Example 2.3 The observed information matrix

Obs_res <- dcminfo(dat=simresp, delta=simdelta, attr_probs=simAttrProbs,
                  q_matrix=simqmatrix, Mj=simMj, Aj=simAj, info_type = "Obs")

# Calculate the covariance matrix of the model parameters based on the Obs matrix
inv_Obs_res <- solve(Obs_res)

Obs_se_delta <- sqrt(diag(inv_Obs_res))[1:N_delta]
Obs_est_delta_se <- data.frame(delta_est= unlist(simdelta), se_delta=Obs_se_delta)
Obs_est_delta_se


#Example 3. User-specified attribute mastery patterns

attr_mast_patt <- amps(q_matrix=simqmatrix)

Sw_res <- dcminfo(dat=simresp, delta=simdelta, attr_probs=simAttrProbs,
attr_mast_patt = attr_mast_patt, q_matrix=simqmatrix, Mj=simMj, Aj=simAj)

Sw_se_delta <- sqrt(diag(Sw_res))[1:N_delta]

Sw_est_delta_se <- data.frame(delta_est= unlist(simdelta), se_delta=Sw_se_delta)
Sw_est_delta_se


#Example 4. Using the gdina function from the CDM package
library("CDM")
d1 <- CDM::gdina(data = sim_DINA_N1000$simresp, q.matrix = sim_DINA_N1000$simqmatrix,
maxit= 1000, rule="DINA", linkfct = "logit", calc.se=FALSE)
delta <- d1$delta
N_delta <- length(unlist(delta))
attr_probs <- d1$control$attr.prob[,1]
attr_mast_patt <- amps(q_matrix=simqmatrix)
Mj <- d1$Mj
Aj <- d1$Aj


#Example 4.1 The sandwich-type covariance matrix

Sw_res <- dcminfo(dat=sim_DINA_N1000$simresp, delta=delta, attr_probs=attr_probs,
                 q_matrix=sim_DINA_N1000$simqmatrix, Mj=Mj, Aj=Aj)

Sw_se_delta <- sqrt(diag(Sw_res))[1:N_delta]

Sw_est_delta_se <- data.frame(delta_est= unlist(delta), se_delta=Sw_se_delta)
Sw_est_delta_se


#Example 4.2 The empirical cross-product information matrix

XPD_res <- dcminfo(dat=sim_DINA_N1000$simresp, delta=delta, attr_probs=attr_probs,
                  q_matrix=simqmatrix, Mj=Mj, Aj=Aj, info_type = "XPD")

# Calculate the covariance matrix of the model parameters based on the XPD matrix
inv_XPD_res <- solve(XPD_res)

XPD_se_delta <- sqrt(diag(inv_XPD_res))[1:N_delta]
XPD_est_delta_se <- data.frame(delta_est= unlist(delta), se_delta=XPD_se_delta)
XPD_est_delta_se


#Example 4.3 The observed information matrix

Obs_res <- dcminfo(dat=sim_DINA_N1000$simresp, delta=delta, attr_probs=attr_probs,
                  q_matrix=simqmatrix, Mj=Mj, Aj=Aj, info_type = "Obs")

# Calculate the covariance matrix of the model parameters based on the Obs matrix
inv_Obs_res <- solve(Obs_res)

Obs_se_delta <- sqrt(diag(inv_Obs_res))[1:N_delta]
Obs_est_delta_se <- data.frame(delta_est= unlist(delta), se_delta=Obs_se_delta)
Obs_est_delta_se

dcminfo documentation built on May 1, 2019, 6:33 p.m.

Related to dcminfo in dcminfo...