Wald.test.Rd
This function flexibly provides the Wald test for any two q-vectors of a given item in the Q-matrix,
but requires that the two q-vectors differ by only one attribute. Additionally, this function needs
to accept a CDM.obj
.
Wald.test(CDM.obj, Q.i, Q.i.k, i = 1)
An object of class CDM.obj
. @seealso CDM
.
A q-vector
Another q-vector
the item you focusing on
An object of class list
containing the following components:
The statistic of the Wald test.
The p value
$$ Wald = \left[\mathbf{R} \times P_{i}(\mathbf{\alpha})\right]^{'} (\mathbf{R} \times \mathbf{V}_{i} \times \mathbf{R})^{-1} \left[\mathbf{R} \times P_{i}(\mathbf{\alpha})\right] $$
set.seed(123)
K <- 3
I <- 20
N <- 500
IQ <- list(
P0 = runif(I, 0.0, 0.2),
P1 = runif(I, 0.8, 1.0)
)
Q <- sim.Q(K, I)
data <- sim.data(Q = Q, N = N, IQ = IQ, model = "GDINA", distribute = "horder")
#> distribute = horder
#> model = GDINA
#> number of attributes: 3
#> number of items: 20
#> num of examinees: 500
#> average of P0 = 0.11
#> average of P1 = 0.915
#> theta_mean = 0.03 , theta_sd = 0.969
#> a = 1.5 1.5 1.5
#> b = -1.5 1.5 0
CDM.obj <- CDM(data$dat, Q)
#>
Iter = 1 Max. abs. change = 0.40236 Deviance = 10482.49
Iter = 2 Max. abs. change = 0.22409 Deviance = 8835.09
Iter = 3 Max. abs. change = 0.05706 Deviance = 8788.29
Iter = 4 Max. abs. change = 0.01184 Deviance = 8780.36
Iter = 5 Max. abs. change = 0.00543 Deviance = 8778.58
Iter = 6 Max. abs. change = 0.00297 Deviance = 8778.11
Iter = 7 Max. abs. change = 0.00162 Deviance = 8777.97
Iter = 8 Max. abs. change = 0.00088 Deviance = 8777.92
Iter = 9 Max. abs. change = 0.00048 Deviance = 8777.90
Iter = 10 Max. abs. change = 0.00024 Deviance = 8777.90
Iter = 11 Max. abs. change = 0.00007 Deviance = 8777.90
Q.i <- c(1, 0, 0)
Q.i.k <- c(1, 1, 0)
## Discuss whether there is a significant difference when
## the q-vector of the 2nd item in the Q-matrix is Q.i or Q.i.k.
Wald.test.obj <- Wald.test(CDM.obj, Q.i, Q.i.k, i=2)
print(Wald.test.obj)
#> $Wald.statistic
#> [,1]
#> [1,] 6.598485
#>
#> $p.value
#> [,1]
#> [1,] 0.03691112
#>