10.8 Estimating 2×2 Contingency Table

To estimate the table for attribute k, we need to know P(αik=a|yi) and I(ˆαik=b|yi). Let us take student 8 as an example. Run the following code:

Code
library(GDINA)
Y <- ecpe$dat
Q <- ecpe$Q
lcdm <- GDINA(Y, Q, model = "GDINA",verbose = 0)
mp <- personparm(lcdm,"mp")
mp.student8 <- mp[8,]
mp.student8
##     A1     A2     A3 
## 0.0041 0.4801 0.9648

Recall that ˆp00=1nni=1P(αik=0|yi)I(ˆαik=0|yi) Verify that for attribute 1 (i.e., k=1) and student 8 (i.e., i=8), I(ˆαik=0|yi)=1 and P(αik=0|yi)= 0.9959

EXERCISES

  • Write your code to estimate p00 and p11 for attribute 1.
  • Compare the classification accuracy of attribute 1 from the analytic solution with the one from Monte Carlo approach.