Learn R Programming

mirt (version 0.1-19)

fscores: Compute factor scores

Description

Computes MAP or EAP factor scores for mirt and bfactor models, or stocastic approximations for polymirt and confmirt. Note that only the general factor scores are computed for bifactor models.

Usage

fscores(object, ...)

## S3 method for class 'mirt':
fscores(object, full.scores = FALSE,
  method = "EAP", ...)

## S3 method for class 'bfactor':
fscores(object, full.scores = FALSE,
  method = "EAP", ...)
  
## S3 method for class 'polymirt':
fscores(object, full.scores = FALSE,
  ndraws = 3000, thin = 5, ...)
  
## S3 method for class 'confmirt':
fscores(object, full.scores = FALSE,
  ndraws = 3000, thin = 5, ...)

Arguments

object
a model of class mirtClass or bfactorClass
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
method
type of factor score estimation method. Can be expected a-posteriori ("EAP") or Bayes modal ("MAP")
ndraws
number of MH samplers to draw for each response pattern
thin
controls how much the chain should be thinned by, default collects every 5th draw. Note that ndraws/thin must be a whole number
...
additional arguments to be passed

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
tabscores <- fscores(mod)
fullscores <- fscores(mod, full.scores = TRUE)

Run the code above in your browser using DataLab