Learn R Programming

mirt (version 0.1-13)

polymirt: Full-Information Item Factor Analysis for Mixed Data Formats

Description

polymirt fits an unconditional maximum likelihood factor analysis model to dichotomous and polychotomous data under the item response theory paradigm using Cai's (2010) Metropolis-Hastings Robbins-Monro algorithm.

Usage

polymirt(data, nfact, guess = 0, prev.cor = NULL,
	ncycles = 2000, burnin = 100, SEM.cycles = 50, kdraws = 1,
    tol = .001, printcycles = TRUE, calcLL = TRUE, draws = 2000,
    debug = FALSE, ...)

## S3 method for class 'polymirt':
summary(object, rotate='varimax', suppress = 0, digits = 3, ...)

## S3 method for class 'polymirt':
coef(object, SE = TRUE, digits = 3, ...)

## S3 method for class 'polymirt':
plot(x, npts = 50, rot = list(x = -70, y = 30, z = 10), ...)

## S3 method for class 'polymirt':
residuals(object, digits = 3, ...)

## S3 method for class 'polymirt':
anova(object, object2, ...)

Arguments

data
a matrix or data.frame that consists of numerically ordered data.
nfact
number of factors to be extracted.
guess
starting values for the pseudo-guessing parameter. Can be entered as a single value to assign a global guessing parameter or may be entered as a numeric vector for each item. When the value is greater than zero the parameter will be estimated.
prev.cor
use a previously computed correlation matrix to be used to estimate starting values the estimation. The input could be any correlation matrix, but it is advised to use a matrix of polychoric correlations.
rotate
type of rotation to perform after the initial orthogonal parameters have been extracted. See below for list of possible rotations
ncycles
the maximum number of iterations to be performed
burnin
number of burn-in cycles to perform before beginning the SEM stage
SEM.cycles
number of stochastic EM cycles to perform before beginning the MH-RM algorithm
kdraws
number of Metropolis-Hastings imputations of the factor scores at each iteration. Default is 1.
tol
tolerance that must be reached before the model is returned
SE
logical; display the standard errors?
x
an object of class polymirt to be plotted or printed
object
a model estimated from polymirt of class polymirt
object2
a model estimated from polymirt of class polymirt
suppress
a numeric value indicating which (possibly rotated) factor loadings should be suppressed. Typical values are around .3 in most statistical software
digits
the number of significant digits to be rounded
npts
number of quadrature points to be used for plotting features. Larger values make plots look smoother
rot
allows rotation of the 3D graphics
printcycles
logical; display iteration history during estimation?
calcLL
logical; calculate the log-likelihood?
draws
the number of Monte Carlo draws to estimate the log-likelihood
debug
logical; turn on debugging features?
...
additional arguments to be passed

Value

  • polymirt returns an object of class polymirt, with the following elements:
  • parsestimated parameters of the model, the rightmost columns being the intercepts
  • guessa vector of the estimated pseudo-guessing parameters
  • SEparsa matrix of standard errors for the parameters estimated
  • Thetalast iteration of the Metropolis-Hastings imputation of the factor scores
  • fulldatacomplete data complete with the original item names and values
  • Funrotated factor loadings matrix
  • h2a vector of communalities
  • cyclesnumber of MHRM cycles performed; will be less than ncycles if the tolerance is reached
  • itemloca vector indicating where the item location begin
  • convergelogical; did the model converge?
  • Callthe function call

Details

polymirt follows the item factor analysis strategy by a stochastic version of maximum likelihood estimation described by Cai (2010). The general equation used for multidimensional item response theory in this package is in the logistic form with a scaling correction of 1.702. This correction is applied to allow comparison to mainstream programs such as TESTFACT (2003) and POLYFACT. Missing data are treated as 'missing at random' so that each response vector is included in the estimation. Residuals are computed using the LD statistic (Chen & Thissen, 1997) in the lower diagonal of the matrix returned by residuals, and Cramer's V above the diagonal. For computing the log-likelihood more accurately see logLik. summary allows for various rotations available from the GPArotation package. These are: [object Object],[object Object] Using plot will plot the test information function for 1 and 2 dimensional solutions. To examine individuals item plots use itemplot (although the plink package is much more suitable for IRT graphics) which will also plot information and surface functions. coef displays the item parameters with their associated standard errors, while use of summary transforms the slopes into a factor loadings metric. Also, factor loading values below a specified constant can be also be suppressed in summary to allow better visual clarity. Models may be compared by using the anova function, where a Chi-squared difference test and AIC difference values are displayed.

References

Cai, L. (2010). High-Dimensional exploratory item factor analysis by a Metropolis-Hastings Robbins-Monro algorithm. Psychometrika, 75, 33-57. Wood, R., Wilson, D. T., Gibbons, R. D., Schilling, S. G., Muraki, E., & Bock, R. D. (2003). TESTFACT 4 for Windows: Test Scoring, Item Statistics, and Full-information Item Factor Analysis [Computer software]. Lincolnwood, IL: Scientific Software International.

See Also

expand.table,key2binary

Examples

Run this code
#load LSAT section 7 data and compute 1 and 2 factor models
data(LSAT7)
fulldata <- expand.table(LSAT7)

(mod1 <- polymirt(fulldata, 1))
summary(mod1)
residuals(mod1)

(mod2 <- polymirt(fulldata, 2))
summary(mod2)
coef(mod2)
anova(mod1,mod2)

###########
#data from the 'ltm' package in numeric format
data(Science)
(mod1 <- polymirt(Science,1))
summary(mod1)
residuals(mod1)
coef(mod1)

(mod2 <- polymirt(Science,2, calcLL = FALSE)) #don't calculate log-likelihood
mod2 <- logLik(mod2,5000) #calc log-likelihood here with more draws
summary(mod2, 'promax', suppress = .3)
coef(mod2)
anova(mod1,mod2)

Run the code above in your browser using DataLab