Learn R Programming

mirt (version 1.1)

fscores: Methods for Function fscores

Description

Computes MAP, EAP, ML (Embretson & Reise, 2000), EAP for sum-scores (Thissen et al., 1995), or WLE (Warm, 1989) factor scores with a multivariate normal prior distribution. Will return either a table with the computed scores and standard errors, the original data matrix with scores appended to the rightmost column, or the scores only. By default the latent means are set to be 0 for each factor, and the covariance matrix is set to the identity matrix, though these can be overwritten. Iterative estimation methods can be estimated in parallel to decrease estimation times if a mirtCluster object is available.

Usage

fscores(object, rotate = "", full.scores = FALSE,
    method = "EAP", quadpts = NULL,
    response.pattern = NULL, degrees = NULL,
    returnER = FALSE, mean = NULL, cov = NULL,
    verbose = TRUE, scores.only = FALSE)

Arguments

object
a computed model object of class ExploratoryClass, ConfirmatoryClass, or MultipleGroupClass
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 (only applicable to ExploratoryClass objects)
method
type of factor score estimation method. Can be expected a-posteriori ("EAP"), Bayes modal ("MAP"), weighted likelihood estimation ("WLE"), maximum likelihood ("ML"), or expected a-posteriori for
quadpts
number of quadratures to use per dimension
mean
a vector for custom latent variable means. If NULL, the default for 'group' values from the computed mirt object will be used
cov
a custom matrix of the latent variable covariance matrix. If NULL, the default for 'group' values from the computed mirt object will be used
degrees
the degrees argument to be passed to iteminfo, only necessary for multidimensional models when method = 'WLE'
response.pattern
an optional argument used to calculate the factor scores and standard errors for a given response vector or matrix
returnER
logical; return empirical reliability (also known as marginal reliability) estimates as a numeric values?
verbose
logical; print verbose output messages?
scores.only
logical; return only the factor scores (only applicable when full.scores = TRUE)

References

Embretson, S. E. & Reise, S. P. (2000). Item Response Theory for Psychologists. Erlbaum.

Thissen, D., Pommerich, M., Billeaud, K., & Williams, V. S. L. (1995). Item Response Theory for Scores on Tests Including Polytomous Items with Ordered Responses. Applied Psychological Measurement, 19, 39-49

Warm, T. A. (1989). Weighted likelihood estimation of ability in item response theory. Psychometrika, 54, 427-450.

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')
scores <- fscores(mod, full.scores = TRUE, scores.only = TRUE)
head(scores)

#calculate MAP for a given response vector
fscores(mod, method='MAP', response.pattern = c(1,2,3,4))
#or matrix
fscores(mod, method='MAP', response.pattern = rbind(c(1,2,3,4), c(2,2,1,3)))

#use custom latent variable properties (diffuse prior for MAP is very close to ML)
fscores(mod, method='MAP', cov = matrix(1000))
fscores(mod, method='ML')

#WLE estimation, run in parallel using available cores
mirtCluster()
fscores(mod, method='WLE')

Run the code above in your browser using DataLab