View source: R/personDistribution.r
personDist | R Documentation |
This function requires a fitted mirt-model of class SingleGroupClass
to visualize a person parameter distribution (theta levels in the studied population). The resulting ggplot can be further customized (e.g., with regard to theme, labels, etc.). It works with both uni- and multidimensional models.
personDist(model, theta_range = c(-4, 4), density = FALSE, bins = 35)
model |
an object of class |
density |
logical value indicating whether a smoothed density curve or a standard histogram should be plotted. |
bins |
number of bins to be plotted in the histogram |
a ggplot object.
# Loading packages
library(mirt)
library(ggmirt)
# Getting data
data <- expand.table(LSAT7)
# Fitting a model
(mod <- mirt(data, 1))
# Simple plot
personDist(mod)
personDist(mod, density = TRUE)
# Customized plot
personDist(mod, theta_range = c(-3, 3), bins = 10) +
theme_classic()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.