Description Usage Arguments Details Author(s) References See Also Examples
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 using equally spaced quadrature. EAP scores for models with more than
three factors are generally not recommended since the integration grid becomes very large,
resulting in slower estimation and less precision if the quadpts
are too low.
Therefore, MAP scores should be used instead of EAP scores for higher dimensional models.
Multiple imputation variants are possible for each estimator if a parameter
information matrix was computed, which are useful if the sample size/number of items were small.
As well, if the model contained latent regression predictors this information will
be used in computing MAP and EAP estimates (for these models, full.scores=TRUE
will always be used). Finally, plausible value imputation is also available, and will also account
for latent regression predictor effects.
1 2 3 4 5 6 7 | fscores(object, method = "EAP", full.scores = TRUE, rotate = "oblimin",
Target = NULL, response.pattern = NULL, plausible.draws = 0,
plausible.type = "normal", quadpts = NULL, returnER = FALSE,
return.acov = FALSE, mean = NULL, cov = NULL, verbose = TRUE,
full.scores.SE = FALSE, theta_lim = c(-6, 6), MI = 0, QMC = FALSE,
custom_den = NULL, custom_theta = NULL, min_expected = 1,
converge_info = FALSE, max_theta = 20, start = NULL, ...)
|
object |
a computed model object of class |
method |
type of factor score estimation method. Can be expected
a-posteriori ( |
full.scores |
if |
rotate |
prior rotation to be used when estimating the factor scores. See
|
Target |
target rotation; see |
response.pattern |
an optional argument used to calculate the factor scores and standard errors for a given response vector or matrix/data.frame |
plausible.draws |
number of plausible values to draw for future researchers
to perform secondary analyses of the latent trait scores. Typically used in conjunction
with latent regression predictors (see |
plausible.type |
type of plausible values to obtain. Can be either |
quadpts |
number of quadratures to use per dimension. If not specified, a suitable
one will be created which decreases as the number of dimensions increases
(and therefore for estimates such as EAP, will be less accurate). This is determined from
the switch statement
|
returnER |
logical; return empirical reliability (also known as marginal reliability) estimates as a numeric values? |
return.acov |
logical; return a list containing covariance matrices instead of factors
scores? |
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 |
verbose |
logical; print verbose output messages? |
full.scores.SE |
logical; when |
theta_lim |
lower and upper range to evaluate latent trait integral for each dimension. If omitted, a range will be generated automatically based on the number of dimensions |
MI |
a number indicating how many multiple imputation draws to perform. Default is 0, indicating that no MI draws will be performed |
QMC |
logical; use quasi-Monte Carlo integration? If |
custom_den |
a function used to define the integration density (if required). The NULL default assumes that the multivariate normal distribution with the 'GroupPars' hyper-parameters are used. At the minimum must be of the form:
where Theta is a matrix of latent trait values (will be a grid of values
if |
custom_theta |
a matrix of custom integration nodes to use instead of the default, where each column corresponds to the respective dimension in the model |
min_expected |
when computing goodness of fit tests when |
converge_info |
logical; include a column in the return objects containing a logical for each
response pattern indicating whether a maximum value was found (not relavent non-iterative methods,
such as EAP and EAPsum). Value is a reflection of the |
max_theta |
the maximum/minimum value any given factor score estimate will achieve using any modal estimator method (e.g., MAP, WLE, ML) |
start |
a matrix of starting values to use for iterative estimation methods. Default
will start at a vector of 0's for each response pattern, or will start at the EAP
estimates (unidimensional models only). Must be in the form that matches
|
... |
additional arguments to be passed to |
The function 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 and covariances are determined from the estimated object,
though these can be overwritten. Iterative estimation methods can be estimated
in parallel to decrease estimation times if a mirtCluster
object is available.
If the input object is a discrete latent class object estimated from mdirt
then the returned results will be with respect to the posterior classification for each
individual. The method inputs for 'DiscreteClass'
objects may only be 'EAP'
,
for posterior classification of each response pattern, or 'EAPsum'
for posterior
classification based on the raw sum-score. For more information on these algorithms refer to
the mirtCAT
package and the associated JSS paper (Chalmers, 2016).
Phil Chalmers rphilip.chalmers@gmail.com
Chalmers, R., P. (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. Journal of Statistical Software, 48(6), 1-29. doi: 10.18637/jss.v048.i06
Chalmers, R. P. (2016). Generating Adaptive and Non-Adaptive Test Interfaces for Multidimensional Item Response Theory Applications. Journal of Statistical Software, 71(5), 1-39. doi: 10.18637/jss.v071.i05
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | ## Not run:
mod <- mirt(Science, 1)
tabscores <- fscores(mod, full.scores = FALSE)
head(tabscores)
fullscores <- fscores(mod)
fullscores_with_SE <- fscores(mod, full.scores.SE=TRUE)
head(fullscores)
head(fullscores_with_SE)
#change method argument to use MAP estimates
fullscores <- fscores(mod, method='MAP')
head(fullscores)
#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), full.scores = FALSE)
fscores(mod, method='ML', full.scores = FALSE)
# EAPsum table of values based on total scores
fscores(mod, method = 'EAPsum', full.scores = FALSE)
#WLE estimation, run in parallel using available cores
mirtCluster()
head(fscores(mod, method='WLE', full.scores = FALSE))
#multiple imputation using 30 draws for EAP scores. Requires information matrix
mod <- mirt(Science, 1, SE=TRUE)
fs <- fscores(mod, MI = 30)
head(fs)
# plausible values for future work
pv <- fscores(mod, plausible.draws = 5)
lapply(pv, function(x) c(mean=mean(x), var=var(x), min=min(x), max=max(x)))
## define a custom_den function. EAP with a uniform prior between -3 and 3
fun <- function(Theta, ...) as.numeric(dunif(Theta, min = -3, max = 3))
head(fscores(mod, custom_den = fun))
# custom MAP prior: standard truncated normal between 5 and -2
library(msm)
# need the :: scope for parallel to see the function (not require if no mirtCluster() defined)
fun <- function(Theta, ...) msm::dtnorm(Theta, mean = 0, sd = 1, lower = -2, upper = 5)
head(fscores(mod, custom_den = fun, method = 'MAP', full.scores = FALSE))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.