| extract | R Documentation |
A generic S3 extractor function designed to retrieve internal components from fitted model objects produced by the ForceChoice package. This function provides a consistent interface across all eight model classes, allowing users to access estimated parameters, fit statistics, latent trait estimates, convergence diagnostics, and model configuration data without directly manipulating the internal list structure.
## S3 method for class 'MIRT'
extract(object, what, ...)
## S3 method for class 'MGPCM'
extract(object, what, ...)
## S3 method for class 'MGGUM'
extract(object, what, ...)
## S3 method for class 'FCMIRT'
extract(object, what, ...)
## S3 method for class 'FCDCM'
extract(object, what, ...)
## S3 method for class 'FCGDINA'
extract(object, what, ...)
## S3 method for class 'FCGGUM'
extract(object, what, ...)
## S3 method for class 'TIRT'
extract(object, what, ...)
object |
An object of one of the following classes:
|
what |
A character string specifying the name of the component to
extract. Valid choices depend on the class of |
... |
Additional arguments passed to methods (currently ignored). |
This function supports extraction from the eight ForceChoice model classes. Below are the available components for each:
MIRT, MGPCM, MGGUMTraditional (single-stimulus) models. Available components:
parList (est, se, Rhat, free)
of item parameter arrays.
thetaList (est, se, Rhat) of
N \times D person parameter matrices.
CorrList (est, se, Rhat) of
D \times D inter-trait correlation matrices.
logLikMarginal log-likelihood (class "logLik").
nparNumber of free parameters.
methodEstimation method ("stan" or "iStEM").
Q.matrixThe I \times D Q-matrix.
length.polyVector of category counts per item (MGPCM, MGGUM only).
stan.objThe stanfit object (Stan only).
MCMC.objThe MCMC extract list (Stan only).
iStEMList of iStEM diagnostics (iStEM only).
callThe matched call.
argumentsList of arguments used for fitting.
FCMIRT, FCGGUMForced-choice models. In addition to the traditional-model components listed above, the following are available:
block.itemsList of item indices in each block.
responseThe N \times B forced-choice response matrix.
patternsList of permissible ranking patterns per block.
patterns.totalList of all possible ranking patterns per block.
fc.typeCharacter vector of forced-choice formats
("RANK", "MOLE", "PICK").
FCDCMForced-Choice DCM. Available components:
parList (est, se, Rhat, free)
of block \eta parameter matrices (B \times 2).
deltaList (est, se, Rhat) of
higher-order \delta parameters (D \times 2).
thetaList (est, se, Rhat) of
N \times 1 higher-order trait estimates.
alphaPosterior mean attribute profile
(N \times D).
alpha.patternsFull enumeration of 2^D
attribute mastery patterns.
zeta.patternsCondensation outputs for each pattern.
dcm.typeDCM condensation rule ("DINA" or
"DINO").
responseThe N \times B binary block response matrix.
block.itemsList of two-statement blocks.
patternsList of binary response patterns per block.
logLikMarginal log-likelihood (class "logLik").
nparNumber of free parameters.
methodEstimation method.
Q.matrixThe I \times D Q-matrix.
stan.obj, MCMC.obj, iStEM, EMEstimation backend objects.
callThe matched call.
argumentsList of arguments used for fitting.
FCGDINAForced-Choice GDINA. Available components:
deltaList (est, se, Rhat) of
item-level CDM delta parameters.
alphaPosterior attribute summaries, including posterior class probabilities when available.
alpha.patternsFull enumeration of 2^D
attribute mastery patterns.
design.matrix.listPer-item CDM design matrices.
response, block.items, patterns,
patterns.total, fc.typeForced-choice data structures.
TIRTThurstonian IRT. Available components:
parList (est, se, Rhat, free)
of statement-level parameter matrices (I \times (D+1)).
thetaList (est, se, Rhat) of
N \times D person parameter matrices.
gammaList (est, se, Rhat,
free) of pairwise \gamma parameters.
gamma.matrixList (est, se, Rhat)
of I \times I skew-symmetric \gamma matrices.
CorrList (est, se, Rhat) of
D \times D inter-trait correlation matrices.
pairs.matrixMatrix of pairwise comparison indices.
pairs.valuePerson-specific pair data (MOLE/PICK).
responseThe N \times I_{pairs} pairwise
response matrix.
block.itemsList of item indices in each block.
fc.typeCharacter vector of forced-choice formats.
Q.matrixThe statement-level Q-matrix.
logLikMarginal log-likelihood (class "logLik").
nparNumber of free parameters.
methodEstimation method.
stan.obj, MCMC.obj, iStEMEstimation backend objects.
callThe matched call.
argumentsList of arguments used for fitting.
The requested component. Return type varies depending on
what and the class of object. If an invalid what
is provided, an informative error is thrown listing valid options.
extract(MIRT): Extract components from MIRT objects.
extract(MGPCM): Extract components from MGPCM objects.
extract(MGGUM): Extract components from MGGUM objects.
extract(FCMIRT): Extract components from FCMIRT objects.
extract(FCDCM): Extract components from FCDCM objects.
extract(FCGDINA): Extract components from FCGDINA objects.
extract(FCGGUM): Extract components from FCGGUM objects.
extract(TIRT): Extract components from TIRT objects.
sim <- sim.data.MIRT(N = 20, I = 6, D = 2, model = "m2pl")
fit <- fit.MIRT(
sim$response, model = "m2pl", D = 2, method = "iStEM",
control.method = list(
vis = FALSE, seed = 123,
M = 2, B = 2, burnin.maxitr = 2,
maxitr = 3, eps1 = 10, eps2 = 10,
estimate.se = FALSE)
)
extract(fit, "par") # item parameter estimates
extract(fit, "theta") # person trait estimates
extract(fit, "Corr") # factor correlation matrix
extract(fit, "npar") # number of free parameters
extract(fit, "logLik") # marginal log-likelihood
extract(fit, "iStEM") # iStEM convergence diagnostics
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.