personfit
calculates the Zh values from Drasgow, Levine and Williams (1985) for
unidimensional and multidimensional models, as well as the infit and outfit statistics.
The returned object is a data.frame
consisting either of the tabulated data or full data with the statistics appended to the
rightmost columns.
personfit(x, method = "EAP", Theta = NULL, stats.only = TRUE, ...)
a computed model object of class SingleGroupClass
or MultipleGroupClass
type of factor score estimation method. See fscores
for more detail
a matrix of factor scores used for statistics that require empirical estimates. If
supplied, arguments typically passed to fscores()
will be ignored and these values will
be used instead
logical; return only the person fit statistics without their associated response pattern?
additional arguments to be passed to fscores()
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
Drasgow, F., Levine, M. V., & Williams, E. A. (1985). Appropriateness measurement with polychotomous item response models and standardized indices. British Journal of Mathematical and Statistical Psychology, 38, 67-86.
Reise, S. P. (1990). A comparison of item- and person-fit methods of assessing model-data fit in IRT. Applied Psychological Measurement, 14, 127-137.
Wright B. D. & Masters, G. N. (1982). Rating scale analysis. MESA Press.
# \donttest{
#make some data
set.seed(1)
a <- matrix(rlnorm(20),ncol=1)
d <- matrix(rnorm(20),ncol=1)
items <- rep('2PL', 20)
data <- simdata(a,d, 2000, items)
# first observation responds 1 for most difficult, 0 for easiest
data[1,] <- ifelse(d > 0, 0, 1)
# second observations answers first half as 1 second half as 0
data[2,] <- rep(1:0, each = 10)
x <- mirt(data, 1)
fit <- personfit(x)
head(fit)
#> outfit z.outfit infit z.infit Zh
#> 1 2.6583642 4.49192881 1.8755634 4.7138592 -6.1443561
#> 2 1.7922743 2.88078449 1.4182142 2.4575860 -2.9692241
#> 3 1.0433747 0.28270415 1.1336178 0.6876459 -0.5328314
#> 4 0.9775579 0.04292907 1.0658716 0.4766072 -0.2816455
#> 5 0.6709186 -0.12413718 0.9331577 -0.2175710 0.4086525
#> 6 0.6974703 -0.99102234 0.7756842 -1.6170480 1.4234536
#using precomputed Theta
Theta <- fscores(x, method = 'MAP', full.scores = TRUE)
head(personfit(x, Theta=Theta))
#> outfit z.outfit infit z.infit Zh
#> 1 2.6491304 4.49038856 1.8764135 4.7156923 -6.1421671
#> 2 1.7828235 2.87132551 1.4191231 2.4587600 -2.9646541
#> 3 1.0131906 0.21667856 1.1069103 0.5942755 -0.4322618
#> 4 0.9752658 0.03144039 1.0636063 0.4637990 -0.2675431
#> 5 0.6543701 -0.11418271 0.8869011 -0.4671270 0.6007619
#> 6 0.6970385 -1.02752175 0.7732412 -1.6329080 1.4394591
# multiple group Rasch model example
set.seed(12345)
a <- matrix(rep(1, 16), ncol=1)
d <- matrix(rnorm(16,0,.7),ncol=1)
itemtype <- rep('dich', nrow(a))
N <- 1000
dataset1 <- simdata(a, d, N, itemtype)
dataset2 <- simdata(a, d, N, itemtype, sigma = matrix(1.5))
dat <- rbind(dataset1, dataset2)
# first observation responds 1 for most difficult, 0 for easiest
dat[1,] <- ifelse(d > 0, 0, 1)
group <- c(rep('D1', N), rep('D2', N))
models <- 'F1 = 1-16'
mod_Rasch <- multipleGroup(dat, models, itemtype = 'Rasch', group = group)
coef(mod_Rasch, simplify=TRUE)
#> $D1
#> $items
#> a1 d g u
#> Item_1 1 0.431 0 1
#> Item_2 1 0.446 0 1
#> Item_3 1 -0.039 0 1
#> Item_4 1 -0.217 0 1
#> Item_5 1 0.517 0 1
#> Item_6 1 -1.240 0 1
#> Item_7 1 0.492 0 1
#> Item_8 1 -0.138 0 1
#> Item_9 1 -0.113 0 1
#> Item_10 1 -0.709 0 1
#> Item_11 1 0.054 0 1
#> Item_12 1 1.346 0 1
#> Item_13 1 0.197 0 1
#> Item_14 1 0.436 0 1
#> Item_15 1 -0.456 0 1
#> Item_16 1 0.553 0 1
#>
#> $means
#> F1
#> 0
#>
#> $cov
#> F1
#> F1 1.099
#>
#>
#> $D2
#> $items
#> a1 d g u
#> Item_1 1 0.407 0 1
#> Item_2 1 0.547 0 1
#> Item_3 1 -0.057 0 1
#> Item_4 1 -0.240 0 1
#> Item_5 1 0.290 0 1
#> Item_6 1 -1.293 0 1
#> Item_7 1 0.455 0 1
#> Item_8 1 -0.277 0 1
#> Item_9 1 -0.209 0 1
#> Item_10 1 -0.660 0 1
#> Item_11 1 -0.219 0 1
#> Item_12 1 1.230 0 1
#> Item_13 1 0.332 0 1
#> Item_14 1 0.322 0 1
#> Item_15 1 -0.496 0 1
#> Item_16 1 0.449 0 1
#>
#> $means
#> F1
#> 0
#>
#> $cov
#> F1
#> F1 1.563
#>
#>
pf <- personfit(mod_Rasch, method='MAP')
head(pf)
#> outfit z.outfit infit z.infit Zh
#> 1 1.7020980 3.8601866 1.6168778 4.1292792 -4.7705221
#> 2 1.1927207 1.2391298 1.1583820 1.2242405 -1.2507554
#> 3 1.1600703 0.9795701 1.0933660 0.6952324 -0.7640134
#> 4 0.6421989 -1.2734374 0.7045519 -1.2639180 1.2138762
#> 5 1.0726731 0.3149889 1.0446560 0.2466146 -0.1792088
#> 6 0.8189958 -0.9216193 0.8518569 -0.8904853 0.9128865
# }