Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

extract.mirt

Extract various elements from estimated model objects


Description

A generic function to extract the internal objects from estimated models.

Usage

extract.mirt(x, what)

Arguments

x

mirt model of class 'SingleGroupClass', 'MultipleGroupClass', 'MixedClass' or 'DiscreteGroupClass'

what

a string indicating what to extract

Details

Objects which can be extracted from mirt objects include:

logLik

observed log-likelihood

logPrior

log term contributed by prior parameter distributions

G2

goodness of fit statistic

df

degrees of freedom

p

p-value for G2 statistic

RMSEA

root mean-square error of approximation based on G2

CFI

CFI fit statistic

TLI

TLI fit statistic

AIC

AIC

AICc

corrected AIC

BIC

BIC

SABIC

sample size adjusted BIC

DIC

DIC

HQ

HQ

F

unrotated standardized loadings matrix

h2

factor communality estimates

LLhistory

EM log-likelihood history

tabdata

a tabular version of the raw response data input. Frequencies are stored in freq

freq

frequencies associated with tabdata

K

an integer vector indicating the number of unique elements for each item

mins

an integer vector indicating the lowest category found in the input data

model

input model syntax

method

estimation method used

itemtype

a vector of item types for each respective item (e.g., 'graded', '2PL', etc)

itemnames

a vector of item names from the input data

factorNames

a vector of factor names from the model definition

rowID

an integer vector indicating all valid row numbers used in the model estimation (when all cases are used this will be 1:nrow(data)). Mostly useful when the option technical = list(removeEmptyRows = TRUE) was passed

data

raw input data of item responses

covdata

raw input data of data used as covariates

tabdatalong

similar to tabdata, however the responses have been transformed into dummy coded variables

fulldatalong

analogous to tabdatafull, but for the raw input data instead of the tabulated frequencies

exp_resp

expected probability of the unique response patterns

survey.weights

if supplied, the vector of survey weights used during estimation (NULL if missing)

converged

a logical value indicating whether the model terminated within the convergence criteria

iterations

number of iterations it took to reach the convergence criteria

nest

number of freely estimated parameters

parvec

vector containing uniquely estimated parameters

vcov

parameter covariance matrix (associated with parvec)

condnum

the condition number of the Hessian (if computed). Otherwise NA

constrain

a list of item parameter constraints to indicate which item parameters were equal during estimation

Prior

prior density distribution for the latent traits

key

if supplied, the data scoring key

nfact

number of latent traits/factors

nitems

number of items

ngroups

number of groups

groupNames

character vector of unique group names

group

a character vector indicating the group membership

secondordertest

a logical indicating whether the model passed the second-order test based on the Hessian matrix. Indicates whether model is a potential local maximum solution

SEMconv

logical; check whether the supplemented EM information matrix converged. Will be NA if not applicable

time

estimation time, broken into different sections

Author(s)

References

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

See Also

Examples

## Not run: 
mod <- mirt(Science, 1)

extract.mirt(mod, 'logLik')
extract.mirt(mod, 'F')

#multiple group model
grp <- rep(c('G1', 'G2'), each = nrow(Science)/2)
mod2 <- multipleGroup(Science, 1, grp)

grp1 <- extract.group(mod2, 1) #extract single group model
extract.mirt(mod2, 'parvec')
extract.mirt(grp1, 'parvec')


## End(Not run)

mirt

Multidimensional Item Response Theory

v1.33.2
GPL (>= 3)
Authors
Phil Chalmers [aut, cre] (<https://orcid.org/0000-0001-5332-2810>), Joshua Pritikin [ctb], Alexander Robitzsch [ctb], Mateusz Zoltak [ctb], KwonHyun Kim [ctb], Carl F. Falk [ctb], Adam Meade [ctb], Lennart Schneider [ctb], David King [ctb], Chen-Wei Liu [ctb], Ogreden Oguzhan [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.