get.PVAF {Qval}R Documentation

Calculate PVAFPVAF

Description

The function is able to caculate the proportion of variance accounted for (PVAFPVAF) for all items after fitting CDM or directly.

Usage

get.PVAF(Y = NULL, Q = NULL, CDM.obj = NULL, model = "GDINA")

Arguments

Y

A required N × I matrix or data.frame consisting of the responses of N individuals to I items. Missing values should be coded as NA.

Q

A required binary I × K matrix containing the attributes not required or required, coded as 0 or 1, to master the items. The ith row of the matrix is a binary indicator vector indicating which attributes are not required (coded as 0) and which attributes are required (coded as 1) to master item i.

CDM.obj

An object of class CDM.obj. Can can be NULL, but when it is not NULL, it enables rapid verification of the Q-matrix without the need for parameter estimation. @seealso CDM.

model

Type of model to be fitted; can be "GDINA", "LCDM", "DINA", "DINO", "ACDM", "LLM", or "rRUM". Default = "GDINA".

Details

The intrinsic essence of the GDI index (as denoted by ζ2\zeta_{2}) is the weighted variance of all 2K2^{K\ast} attribute mastery patterns' probabilities of correctly responding to item ii, which can be computed as:

ζ2=l=12Kπl(P(Xpi=1αl)Pimean)2 \zeta^2 = \sum_{l=1}^{2^K} \pi_{l}{(P(X_{pi}=1|\mathbf{\alpha}_{l}) - P_{i}^{mean})}^2

where πl\pi_{l} represents the prior probability of mastery pattern ll; Pimean=k=12KπlP(Xpi=1αl)P_{i}^{mean}=\sum_{k=1}^{2^K}\pi_{l}P(X_{pi}=1|\mathbf{\alpha}_{l}) is the weighted average of the correct response probabilities across all attribute mastery patterns. When the q-vector is correctly specified, the calculated ζ2\zeta^2 should be maximized, indicating the maximum discrimination of the item.

Theoretically, ζ2\zeta^{2} is larger when qi\mathbf{q}_{i} is either specified correctly or over-specified, unlike when qi\mathbf{q}_{i} is under-specified, and that when qi\mathbf{q}_{i} is over-specified, ζ2\zeta^{2} is larger than but close to the value of qi\mathbf{q}_{i} when specified correctly. The value of ζ2\zeta^{2} continues to increase slightly as the number of over-specified attributes increases, until qi\mathbf{q}_{i} becomes qi1:K\mathbf{q}_{i1:K}. Thus, ζ2/ζmax2\zeta^{2} / \zeta_{max}^{2} is computed to indicate the proportion of variance accounted for by qi\mathbf{q}_{i} , called the PVAFPVAF.

Value

An object of class matrix, which consisted of PVAFPVAF for each item and each possible attribute mastery pattern.

Author(s)

Haijiang Qin <Haijiang133@outlook.com>

References

de la Torre, J., & Chiu, C. Y. (2016). A General Method of Empirical Q-matrix Validation. Psychometrika, 81(2), 253-273. DOI: 10.1007/s11336-015-9467-8.

See Also

validation

Examples

library(Qval)

set.seed(123)

## generate Q-matrix and data
K <- 3
I <- 20
example.Q <- sim.Q(K, I)
IQ <- list(
  P0 = runif(I, 0.0, 0.2),
  P1 = runif(I, 0.8, 1.0)
)
example.data <- sim.data(Q = example.Q, N = 500, IQ = IQ, model = "GDINA", distribute = "horder")

## calculate PVAF directly
PVAF <-get.PVAF(Y = example.data$dat, Q = example.Q)
print(PVAF)

## caculate PVAF after fitting CDM
example.CDM.obj <- CDM(example.data$dat, example.Q, model="GDINA")
PVAF <-get.PVAF(CDM.obj = example.CDM.obj)
print(PVAF)


[Package Qval version 0.1.7 Index]