Learn R Programming

mirt (version 0.3.0)

fscores: Methods for Function fscores

Description

Computes MAP, EAP, or ML factor scores for mirt and bfactor models, or a stochastic approximation with a multivariate normal prior for polymirt and confmirt. Note that only the general factor scores are computed for bifactor models.

Arguments

object
a model of class mirtClass, bfactorClass, or confmirtClass
full.scores
if FALSE (default) then a summary table with factor scores for each unique pattern is displayed. Otherwise the original data matrix is returned with the computed factor scores appended to the rightmost column
rotate
rotation declaration to be used when estimating the factor scores. If "" then the object@rotate default value is used
method
type of factor score estimation method. Can be expected a-posteriori ("EAP"), Bayes modal ("MAP"), or maximum likelihood ("ML"). Only applicable to mirtClass and bfactorClass objects
quadpts
number of quadratures to use per dimension. Only applicable for mirtClass and bfactorClass objects
ndraws
number of MH samples to draw for each response pattern for confmirtClass objects
thin
controls how much the chain should be thinned by, default collects every 5th draw (thin = 5). Note that ndraws/thin must be a whole number. for confmirtClass objects only
verbose
logical; print verbose output messages?

Value

  • Returns either a summary table with the response patterns and expected factor scores, or a complete data matrix with factor scores appended to the last column.

Examples

Run this code
mod <- mirt(Science, 1)
tabscores <- fscores(mod)
fullscores <- fscores(mod, full.scores = TRUE)
fullscores <- fscores(mod, full.scores = TRUE, method='MAP')

mod2 <- confmirt(Science, 1)
tabscores2 <- fscores(mod2, ndraws = 5000)

Run the code above in your browser using DataLab