get.priority {Qval} | R Documentation |
This function will provide the priorities of attributes for all items.
get.priority(Y = NULL, Q = NULL, CDM.obj = NULL, model = "GDINA")
Y |
A required |
Q |
A required binary |
CDM.obj |
An object of class |
model |
Type of model to fit; can be |
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}]
A matrix containing all attribute priorities.
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)
)
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)