knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  fig.retina = 2
)

ggmirt

Lifecycle: experimental CRAN status

This package extends the great R-package mirt (Multidimensional item response theory; Chalmers, 2021) with functions for creating publication-ready and customizable figures. Although the mirt-packages already includes possibilities to plot various aspects relevant to understanding IRT analyses (e.g., item plots, trace-plots, etc.), it does not employ ggplot2, which provides more flexibility and customizability. This package provides some functions to recreate such plots with ggplot2.

If you want to learn how to use mirt in combination with ggmirt to run various IRT analyses, please check out the following tutorials:

Please note: This package is still under development. It is currently rather a place where I dump some functions that I use often, but I have not fully tested them under different scenarios and with different type of models. If you are interested in contributing, feel free to reach out.

Installation

# install.packages("devtools")
devtools::install_github("masurp/ggmirt")

Usage

# Load packages
library(mirt)
library(ggmirt)

# Simulate some data
data <- sim_irt(500, 8, seed = 123)

# Run IRT model with mirt
mod <- mirt(data, 1, itemtype = "2PL", verbose = FALSE)

# Plot item-person map
itempersonMap(mod)
# Item characteristic curves
tracePlot(mod)
# Item information curves
itemInfoPlot(mod)
# Scale characteristic curve
scaleCharPlot(mod)
# Test information curves
testInfoPlot(mod, adj_factor = 1.75)
# Item infit and outfit statistics
itemfitPlot(mod)
# Person fit statisitcs
personfitPlot(mod)
# Conditional reliability
conRelPlot(mod)

Next to individual plot functions, there is also a comprehensive summaryPlot()-function, which provides a lot of information about IRT models with just a line of code.

summaryPlot(mod, adj_factor = 1.75)

How to cite this package

citation("ggmirt")


masurp/ggmirt documentation built on Oct. 14, 2023, 1:16 p.m.