extract | R Documentation |
A generic function to extract elements from objects of class CDM
, validation
or sim.data
.
Objects which can be extracted from CDM
object include:
An GDINA
object (@seealso GDINA
) gained from GDINA
package or an
list
after BM algorithm, depending on which estimation is used.
Individuals' attribute parameters calculated by EAP method
Individual's posterior probability
Individuals' marginal mastery probabilities matrix
Attribute prior weights for calculating marginalized likelihood in the last iteration
deviance, or negative two times observed marginal log likelihood
The number of parameters
AIC
BIC
Objects which can be extracted from validation
object include:
The original Q-matrix that maybe contain some mis-specifications and need to be validated.
The Q-matrix that suggested by certain validation method.
The time that CPU cost to finish the validation.
A matrix that contains the modification process of each item during each iteration.
Each row represents an iteration, and each column corresponds to the q-vector index of respective
item. The order of the indices is consistent with the row number in the matrix generated by
the attributepattern
function in the GDINA
package. Only when
maxitr
> 1, the value is available.
The number of iteration. Only when maxitr
> 1, the value is available.
An I
× K
matrix that contains the priority of every attribute for
each item. Only when the search.method
is "PAA"
, the value is available.
A list
containing all the information needed to plot the Hull plot, which is
available only when method
= "Hull"
.
Objects which can be extracted from sim.data
object include:
An N
× I
simulated item response matrix.
The Q-matrix.
An N
× K
matrix for inviduals' attribute patterns.
A list of non-zero category success probabilities for each attribute mastery pattern.
A list of delta parameters.
Higher-order parameters.
Multivariate normal distribution parameters.
A matrix of item/category success probabilities for each attribute mastery pattern.
extract(object, what, ...)
## S3 method for class 'CDM'
extract(object, what, ...)
## S3 method for class 'validation'
extract(object, what, ...)
## S3 method for class 'sim.data'
extract(object, what, ...)
object |
objects from class |
what |
what to extract |
... |
Additional arguments. |
extract(CDM)
: various elements of CDM
object
extract(validation)
: various elements of validation
object
extract(sim.data)
: various elements of sim.data
object
set.seed(123)
library(Qval)
## generate Q-matrix and data to fit
K <- 3
I <- 30
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 = 1000, IQ = IQ,
model = "GDINA", distribute = "horder")
extract(example.data,"dat")
## using MMLE/EM to fit GDINA model
example.CDM.obj <- CDM(example.data$dat, example.Q, model = "GDINA",
method = "EM", maxitr = 2000, verbose = 1)
extract(example.CDM.obj,"alpha")
extract(example.CDM.obj,"npar")
example.MQ <- sim.MQ(example.Q, 0.1)
example.CDM.obj <- CDM(example.data$dat, example.MQ, model = "GDINA",
method = "EM", maxitr = 2000, verbose = 1)
validation.obj <- validation(example.data$dat, example.MQ,
example.CDM.obj, method = "MLR-B", eps = 0.90)
extract(validation.obj,"Q.sug")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.