Function to calculate the area under a selection of information curves
Source:R/areainfo.R
areainfo.Rd
Compute the area of a test or item information function over a definite integral range.
Usage
areainfo(
x,
theta_lim,
which.items = 1:extract.mirt(x, "nitems"),
group = NULL,
...
)
Arguments
- x
an object of class 'SingleGroupClass', or an object of class 'MultipleGroupClass' if a suitable
group
input were supplied- theta_lim
range of integration to be computed
- which.items
an integer vector indicating which items to include in the expected information function. Default uses all possible items
- group
group argument to pass to
extract.group
function. Required when the input object is a multiple-group model- ...
additional arguments passed to
integrate
Value
a data.frame
with the lower and upper integration range, the information area
within the range (Info), the information area over the range -10 to 10 (Total.Info), proportion
of total information given the integration range (Info.Proportion), and the number of items included (nitems)
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
Author
Phil Chalmers rphilip.chalmers@gmail.com
Examples
dat <- expand.table(LSAT7)
mod <- mirt(dat, 1)
#>
Iteration: 1, Log-Lik: -2668.786, Max-Change: 0.18243
Iteration: 2, Log-Lik: -2663.691, Max-Change: 0.13637
Iteration: 3, Log-Lik: -2661.454, Max-Change: 0.10231
Iteration: 4, Log-Lik: -2659.430, Max-Change: 0.04181
Iteration: 5, Log-Lik: -2659.241, Max-Change: 0.03417
Iteration: 6, Log-Lik: -2659.113, Max-Change: 0.02911
Iteration: 7, Log-Lik: -2658.812, Max-Change: 0.00456
Iteration: 8, Log-Lik: -2658.809, Max-Change: 0.00363
Iteration: 9, Log-Lik: -2658.808, Max-Change: 0.00273
Iteration: 10, Log-Lik: -2658.806, Max-Change: 0.00144
Iteration: 11, Log-Lik: -2658.806, Max-Change: 0.00118
Iteration: 12, Log-Lik: -2658.806, Max-Change: 0.00101
Iteration: 13, Log-Lik: -2658.805, Max-Change: 0.00042
Iteration: 14, Log-Lik: -2658.805, Max-Change: 0.00025
Iteration: 15, Log-Lik: -2658.805, Max-Change: 0.00026
Iteration: 16, Log-Lik: -2658.805, Max-Change: 0.00023
Iteration: 17, Log-Lik: -2658.805, Max-Change: 0.00023
Iteration: 18, Log-Lik: -2658.805, Max-Change: 0.00021
Iteration: 19, Log-Lik: -2658.805, Max-Change: 0.00019
Iteration: 20, Log-Lik: -2658.805, Max-Change: 0.00017
Iteration: 21, Log-Lik: -2658.805, Max-Change: 0.00017
Iteration: 22, Log-Lik: -2658.805, Max-Change: 0.00015
Iteration: 23, Log-Lik: -2658.805, Max-Change: 0.00015
Iteration: 24, Log-Lik: -2658.805, Max-Change: 0.00013
Iteration: 25, Log-Lik: -2658.805, Max-Change: 0.00013
Iteration: 26, Log-Lik: -2658.805, Max-Change: 0.00011
Iteration: 27, Log-Lik: -2658.805, Max-Change: 0.00011
Iteration: 28, Log-Lik: -2658.805, Max-Change: 0.00010
areainfo(mod, c(-2,0), which.items = 1) #item 1
#> LowerBound UpperBound Info TotalInfo Proportion nitems
#> -2 0 0.3899825 0.9879254 0.3947489 1
if (FALSE) { # \dontrun{
areainfo(mod, c(-2,0), which.items = 1:3) #items 1 to 3
areainfo(mod, c(-2,0)) # all items (total test information)
# plot the area
area <- areainfo(mod, c(-2,0))
Theta <- matrix(seq(-3,3, length.out=1000))
info <- testinfo(mod, Theta)
plot(info ~ Theta, type = 'l')
pick <- Theta >= -2 & Theta <=0
polygon(c(-2, Theta[pick], 0), c(0, info[pick], 0), col='lightblue')
text(x = 2, y = 0.5, labels = paste("Total Information:", round(area$TotalInfo, 3),
"\n\nInformation in (-2, 0):", round(area$Info, 3),
paste("(", round(100 * area$Proportion, 2), "%)", sep = "")), cex = 1.2)
} # }