knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%", fig.retina = 2 )
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.
# install.packages("devtools") devtools::install_github("masurp/ggmirt")
# 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)
citation("ggmirt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.