Learn R Programming

Qval (version 1.1.1)

get.priority: Priority of Attribute

Description

This function will provide the priorities of attributes for all items.

Usage

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

Value

A matrix containing all attribute priorities.

Arguments

Y

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

Q

A required binary I × K containing the attributes not required or required, 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 by 0) and which attributes are required (coded by 1) to master item i.

CDM.obj

An object of class CDM.obj. 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 fit; can be "GDINA", "LCDM", "DINA", "DINO" , "ACDM", "LLM", or "rRUM". Default = "GDINA". @seealso CDM.

Details

The calculation of priorities is straightforward: the priority of an attribute is the regression coefficient obtained from a LASSO multinomial logistic regression, with the attribute as the independent variable and the response data from the subjects as the dependent variable. The formula is as follows:

$$ \log[\frac{P(X_{\pi} = 1 | \mathbf{\Lambda}_{p})}{P(X_{\pi} = 0 | \mathbf{\Lambda}_{p})}] = logit[P(X_{\pi} = 1 | \mathbf{\Lambda}_{p})] = \beta_{i0} + \beta_{i1} \Lambda_{p1} + \ldots + \beta_{ik} \Lambda_{pk} + \ldots + \beta_{iK} \Lambda_{pK} $$

The LASSO loss function can be expressed as:

$$l_{lasso}(\mathbf{X}_i | \mathbf{\Lambda}) = l(\mathbf{X}_i | \mathbf{\Lambda}) - \lambda |\mathbf{\beta}_i|$$

The priority for attribute \(i\) is defined as: \(\mathbf{priority}_i = [\beta_{i1}, \ldots, \beta_{ik}, \ldots, \beta_{iK}]\)

Examples

Run this code
set.seed(123)
library(Qval)

## generate Q-matrix and data
K <- 5
I <- 20
IQ <- list(
  P0 = runif(I, 0.1, 0.3),
  P1 = runif(I, 0.7, 0.9)
)

# \donttest{
Q <- sim.Q(K, I)
data <- sim.data(Q = Q, N = 500, IQ = IQ, model = "GDINA", distribute = "horder")
MQ <- sim.MQ(Q, 0.1)

CDM.obj <- CDM(data$dat, MQ)

priority <- get.priority(data$dat, Q, CDM.obj)
head(priority)
# }


Run the code above in your browser using DataLab