zTPR.Rd
Caculate true-positive rate (TPR)
zTPR(Q.true, Q.orig, Q.sug)
A numeric (TPR index).
TPR is defned as the proportion of correct elements which are correctly retained:
$$
TPR = \frac{\sum_{i=1}^{I}\sum_{k=1}^{K}I(q_{ik}^{t} = q_{ik}^{s} | q_{ik}^{t} = q_{ik}^{o})}
{\sum_{i=1}^{I}\sum_{k=1}^{K}I(q_{ik}^{t} = q_{ik}^{o})}
$$
where \(q_{ik}^{t}\) denotes the k
th attribute of item \(i\) in the true Q-matrix (Q.true
),
\(q_{ik}^{o}\) denotes k
th attribute of item i
in the original Q-matrix(Q.orig
),
\(q_{ik}^{s}\) denotes k
th attribute of item i
in the suggested Q-matrix(Q.sug
),
and \(I(\cdot)\) is the indicator function.
library(Qval)
set.seed(123)
example.Q1 <- sim.Q(5, 30)
example.Q2 <- sim.MQ(example.Q1, 0.1)
#> rate of mis-specifications = 0.1
#> rate of over-specifications = 0.07
#> rate of under-specifications = 0.03
example.Q3 <- sim.MQ(example.Q1, 0.05)
#> rate of mis-specifications = 0.05
#> rate of over-specifications = 0.03
#> rate of under-specifications = 0.01
TPR <- zTPR(example.Q1, example.Q2, example.Q3)
print(TPR)
#> [1] 0.9481481