get.PVAF: Calculate PVAF

View source: R/IndexPVAF.R

get.PVAFR Documentation

Calculate PVAF

Description

The function is able to calculate the proportion of variance accounted for (PVAF) 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 N × I items. Missing values need to be coded as NA.

Q

A required binary I × K matrix containing the attributes not required or required master the items. The ith row of the matrix is a binary indicator vector indicating which attributes are not required (coded by 0) and which attributes are required (coded by 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 \zeta_{2}) is the weighted variance of all 2^{K\ast} attribute mastery patterns' probabilities of correctly responding to item i, which can be computed as:

\zeta^2 = \sum_{l=1}^{2^K} \pi_{l}{(P(X_{pi}=1|\boldsymbol{\alpha}_{l}) - \bar{P}_{i})}^2

where \pi_{l} represents the prior probability of mastery pattern l; \bar{P}_{i}=\sum_{k=1}^{2^K}\pi_{l}P(X_{pi}=1|\boldsymbol{\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 \zeta^2 should be maximized, indicating the maximum discrimination of the item.

Theoretically, \zeta^{2} is larger when \boldsymbol{q}_{i} is either specified correctly or over-specified, unlike when \boldsymbol{q}_{i} is under-specified, and that when \boldsymbol{q}_{i} is over-specified, \zeta^{2} is larger than but close to the value of \boldsymbol{q}_{i} when specified correctly. The value of \zeta^{2} continues to increase slightly as the number of over-specified attributes increases, until \boldsymbol{q}_{i} becomes \boldsymbol{q}_{i1:K} (\boldsymbol{q}_{i1:K} = [11...1]). Thus, \zeta^{2} / \zeta_{max}^{2} is computed to indicate the proportion of variance accounted for by \boldsymbol{q}_{i}, called the PVAF.

Value

An object of class matrix, which consisted of PVAF for each item and each possible q-vector.

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)

## calculate 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)


Qval documentation built on April 3, 2025, 6:20 p.m.

Related to get.PVAF in Qval...