polymirt
fits an unconditional (exploratory) full-information 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.polymirt(data, nfact, guess = 0, estGuess = NULL, prev.cor = NULL, ncycles = 2000,
burnin = 100, SEM.cycles = 50, kdraws = 1, tol = .001, printcycles = TRUE, calcLL = TRUE,
draws = 2000, debug = FALSE, technical = list(), ...)
## 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, type = 'info', rot = list(x = -70, y = 30, z = 10), ...)
## S3 method for class 'polymirt':
residuals(object, restype = 'LD', digits = 3, ...)
## S3 method for class 'polymirt':
anova(object, object2, ...)
matrix
or data.frame
that consists of numerically ordered dataguess
). By default, if any value in guess
is greater than 0 then its respective estG
mirt
for a list of possible rotationspolymirt
to be plotted or printedpolymirt
of class polymirt
polymirt
of class polymirt
'LD'
for a local dependence matrix (Chen & Thissen, 1997) or 'exp'
for the expected values for the frequencies of every response pattern'info'
or 'infocontour'
to plot test information plotspolymirt
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 (i.e., full-information). 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
.
Use of plot
will display 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.expand.table
, key2binary
#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