5.3 Likelihood of an individual response vector (Cont’d)

Suppose these items are DINA-type items and assume that guessing and slip parameters are .1 and .2 respectively for all of them.

Recall that for the DINA model, the conditional success probability of student \(i\) to item \(j\) is \[\begin{equation} P(Y_{ij}=1|\mathbf{\alpha}_{c})= \begin{cases} g_j & \quad \text{if } \mathbf{\alpha}_{c}^T\mathbf{q}_j< \mathbf{q}_{j}^T\mathbf{q}_j\\ 1-s_j & \quad \text{otherwise} \end{cases} \end{equation}\]

Calculate the conditional success probability \(P(Y_{j}=1|\mathbf{\alpha}_c)\), which can be saved in a matrix with each item (in rows) and each attribute profile (i.e., 00,10,01 and 11 in columns):

Code
g <- 0.1
s <- 0.2
J <- 5
K <- 2
N <- 10
p.y.given.alpha <- matrix(NA, nrow = J, ncol = 2^K)
attributeprofiles <- GDINA::attributepattern(2)
for (j in 1:J) {
    for (a in 1:2^K) {
        if (sum(attributeprofiles[a, ] * Q[j, ]) < sum(Q[j, ] * Q[j, ])) {
            p.y.given.alpha[j, a] <- g
        } else {
            p.y.given.alpha[j, a] <- 1 - s
        }
    }
}
00 10 01 11
item 1 0.1 0.8 0.1 0.8
item 2 0.1 0.8 0.1 0.8
item 3 0.1 0.1 0.8 0.8
item 4 0.1 0.1 0.8 0.8
item 5 0.1 0.1 0.1 0.8

Let \(\alpha_i\) be the attribute profile of student \(i\). Under the assumption of local independence, the likelihood of observing a response vector \(\mathbf{Y}_i\) for student \(i\) is

\[\begin{equation} L( {\mathbf{Y}_i}|{\alpha_i})=\prod_{j = 1}^J P ({Y_{ij}}=1|\mathbf{\alpha}_i)^{Y_{ij}}[1 - P(Y_{ij}=1|\mathbf{\alpha}_i)]^{1 - {Y_{ij}}} \end{equation}\]

Exercise 5.1 Verify that for the first student, \(L( {\mathbf{Y}_1}|{\mathbf{\alpha} _i=10})=.00144\).

What is \(L( {\mathbf{Y}_3}|{\mathbf{\alpha} _i=01})\)?

Click for Answer

\(L( {\mathbf{Y}_i}|{\mathbf{\alpha} _c})\) can be presented in a matrix of \(N\times 2^K\):

Code
Li.given.alpha.c <- matrix(NA, nrow = 10, ncol = 4)
for (i in 1:10) {
    # for each student for each latent class
    for (cc in 1:4) {
        Li.given.alpha.c[i, cc] <- prod((p.y.given.alpha[, cc]^y[i, ]) *
            (1 - p.y.given.alpha[, cc])^(1 - y[i, ]))
    }
}
colnames(Li.given.alpha.c) <- c("00", "10", "01", "11")
rownames(Li.given.alpha.c) <- paste("student", 1:10)
Li.given.alpha.c
##                 00      10      01     11
## student 1  0.00081 0.00144 0.00144 0.0205
## student 2  0.00729 0.01296 0.01296 0.0051
## student 3  0.00081 0.00004 0.05184 0.0205
## student 4  0.00081 0.05184 0.00144 0.0205
## student 5  0.00729 0.01296 0.00036 0.0051
## student 6  0.00729 0.00036 0.01296 0.0051
## student 7  0.00729 0.01296 0.01296 0.0051
## student 8  0.00009 0.00016 0.00576 0.0819
## student 9  0.00081 0.05184 0.00144 0.0205
## student 10 0.00081 0.00144 0.00144 0.0205