info.plot: Plot the information function for a judge or for the entire...

View source: R/info.plot.R

info.plotR Documentation

Plot the information function for a judge or for the entire set of judges.

Description

This function returns the Judge Information Function plot from a jrt object and the judge number. Information can be plotted as such, as reliability or as standard error. The function may also be used for the information of the entire set of judges. This is a wrapper function and adaptation of the itemplot function in the package mirt (Chalmers, 2012). It also uses the plotting functions of the packages directlabels and ggplot2.

Usage

info.plot(
  jrt.object,
  judge = "all",
  type = "information",
  title = "auto",
  column.names = "auto",
  theta.span = 3.5,
  y.limits = NULL,
  y.line = NULL,
  name.for.y.line = "Threshold",
  y.line.refers.to.secondary.axis = TRUE,
  greyscale = FALSE,
  color.palette = "D3",
  line.type = 1,
  line.width = 1,
  key.width = 3,
  legend.position = "right",
  legend.columns = "",
  theme = "bw",
  text.size = 10,
  title.size = text.size + 4,
  remove.gridlines = TRUE,
  font.family = "sans",
  precision = 20,
  mirt.object.input = F,
  item = NULL
)

Arguments

jrt.object

A object of the jrt class (created by the function jrt).

judge

A numerical to indicate which judge to plot. Be careful : If a (Generalized) Rating Scale Model was used, then judges may have been removed for the model to be fitted. Provide "all" to get the information plot for all judges.

type

A character to indicate what to plot on the y axis, "information" for Information, "reliability" for Reliability, or "SE" for standard errors. Alternatively, use "infose" (or ise) to plot information and standard error of measurement in the same plot. Use "inforxx" (or ir) to plot information and reliability in the same plot.

title

A character title for the plot. By default it is created automatically based on the judge number.

column.names

A character to indicate how a judge should be called (Defaults to "auto", which uses what was set in the estimation function jrt, whose default is "judge", but you may use "Rater", "Expert", etc.). This is used to create automatic titles.

theta.span

A numeric indicating the maximum \theta. The minimum is automatically adjusted to -theta.span.

y.limits

A numeric vector to manually adjust the minimum and maximum of the y axis (may notably be useful if using reliability). Set to NULL (default) to automatically set with ggplot2.

y.line

A numeric to add a (dashed) horizontal line on the plot at the y value indicated (for example for a threshold of acceptable reliability). Defaults to NULL, which does not plot the line. Note that the y level is in reference to the primary axis, if there are two y axes.

name.for.y.line

A character to indicate how to call the y line in the legend. Default is "Threshold".

y.line.refers.to.secondary.axis

A logical to indicate if the y.line should refer to a value on the secondary axis (TRUE, default) or the primary (FALSE). Only used if there is a secondary axis. The default is TRUE because threshold values for interpretation are more often used for reliability or standard error than information.

greyscale

A logical (default is FALSE) to indicate whether to use greyscale graphics (useful for publication). Uses variations in linetype as opposed to variations in line colors.

color.palette

A character value to indicate the colour palette to use. Defaults to "D3" from "ggsci". Use "" for the default of ggplot2. The palettes are supplied as arguments in the scale_fill_brewer() function of ggplot2. In addition, most palettes from the package ggsci are available (e.g., "npg", "aas", "nejm", "lancet", "jama", "d3"). Use vignette("ggsci") for details.

line.type

A numeric indicating the line type for the information function curve (default is 1 for a plain line. This would be used if overlaying multiple plots.

line.width

A numeric indicating the width for the information function curve (default is 2.5).

key.width

A numeric to indicate the width of the legend key (default is 3).

legend.position

A character string or vector of coordinates to position the legend key. Defaults to "right". Other possibilities include notably "bottom".

legend.columns

A numeric to indicate after how many legend key elements to add a line break. Especially useful if using legend.position = "bottom" if you want line breaks between each key. Defaults to "", which automatically saves space based on the legend position (line breaks are used if the legend in positioned on the side of the graph).

theme

A character value to indicate the background color theme used by ggplot2. Defaults to "bw". Can be "light", "dark", "minimal", "classic", "gray", "bw" or "linedraw".

text.size

A numeric value to control the size of the text on the plot.

title.size

A numeric value to control the size of the plot title (defaults to text.size+4).

remove.gridlines

A logical value to remove the gridlines (default is TRUE).

font.family

A character value to control the font family used on the graph. Defaults to "sans". Other possible values include "serif" or "mono".

precision

A numeric to indicate the degree of precision used to plot the curves. Higher values will increase the accuracy of the graph and make the curves look smoother, but the data generated to plot the graph will be bigger, which will slow down the function. Lower values will do the opposite. Values between 10 and 100 are recommended, 20 is the default and sufficient for most uses.

mirt.object.input

A logical allowing to input directly an mirt object as a jrt.object argument, even though this should be detected automatically. See mirt package documentation, and note that this is a secondary use that may lead to inconsistent results at this point.

item

For convenience, this argument, more standard to IRT packages, can be used instead of the judge argument.

Value

A plot of the information, reliability or standard error function.

References

Chalmers, R., P. (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. Journal of Statistical Software, 48(6), 1-29. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v048.i06")}

Myszkowski, N., & Storme, M. (2019). Judge Response Theory? A call to upgrade our psychometrical account of creativity judgments. Psychology of Aesthetics, Creativity and the Arts, 13(2), 167-175. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/aca0000225")}

Myszkowski, N. (2021). Development of the R library “jrt”: Automated item response theory procedures for judgment data and their application with the consensual assessment techniques. Psychology of Aesthetics, Creativity and the Arts, 15(3), 426-438. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/aca0000287")}

Examples


# Load dataset
data <- jrt::ratings

# Fit model
fit <- jrt(data, irt.model = "PCM")

# Information function of the first judge
info.plot(fit, 1)

# Reliability function of the second judge
info.plot(fit, 2, type = "reliability")

# Standard error function of the entire set of judges
info.plot(fit, "all", type = "SE")

# See vignette for more options


jrt documentation built on April 14, 2023, 12:35 a.m.