philchalmers / mirt

Multidimensional item response theory
https://philchalmers.github.io/mirt/
199 stars 75 forks source link

mirt() returns NaN for CFI and TLI #172

Closed LeonhardBakker closed 4 years ago

LeonhardBakker commented 4 years ago

Example

I tried to replicate the example from the documentation, but it returns NaN for CFI and TLI.

library(mirt)

 dat <- expand.table(LSAT7) 
 lsat_mod <- mirt(dat, 1) 
 print(lsat_mod)

mirt - CFI & TLI - NaN.pdf

philchalmers commented 4 years ago

This was changed in the argument defaults since these statistics could technically be computed with spare tables (even though they strongly shouldn't be). To obtain them pass calcNull = TRUE explicitly.

> library(mirt)
> 
> dat <- expand.table(LSAT7) 
>  lsat_mod <- mirt(dat, 1, calcNull=TRUE) 
>  print(lsat_mod)

Call:
mirt(data = dat, model = 1, calcNull = TRUE)

Full-information item factor analysis with 1 factor(s).
Converged within 1e-04 tolerance after 28 EM iterations.
mirt version: 1.31.7 
M-step optimizer: BFGS 
EM acceleration: Ramsay 
Number of rectangular quadrature: 61
Latent density type: Gaussian 

Log-likelihood = -2658.805
Estimated parameters: 10 
AIC = 5337.61; AICc = 5337.833
BIC = 5386.688; SABIC = 5354.927
G2 (21) = 31.7, p = 0.0628
RMSEA = 0.023, CFI = 0.939, TLI = 0.924