Learn R Programming

irt (version 0.1.1)

plot.Itempool: Plot Item Characteristic Curves or Test Characteristic Curve of an Itempool object

Description

plot.Itempool plots the item characteristic curves (item response curves) or test characteristic curve of an Itempool-class object.

Usage

# S3 method for Itempool
plot(
  x,
  theta_range = c(-4, 4),
  tcc = FALSE,
  tcc_prop_corr = FALSE,
  title = "",
  suppress_plot = FALSE,
  legend_title = NULL,
  ...
)

Arguments

x

An Itempool-class object.

theta_range

The boundaries of x axis.

tcc

If TRUE a test characteristic curve will be plotted.

tcc_prop_corr

If TRUE, test characteristic curve will be show the proportion correct of the test (i.e. the range of y-axis will be 0-1 instead of 0 to the number of items).

title

Title of the plot. Default is NULL. If tcc is TRUE it will be 'Test Characteristic Curve', if FALSE it will be 'Item Characteristic Curve'.

suppress_plot

If FALSE the function will print the plot. If TRUE, function will return the plot object. Default value is FALSE.

legend_title

The title of the plot's legend.

...

Additional arguments that will be passed to geom_line

Value

Depending on the value of suppress_plot function either prints the item characteristic curve or returns the plot object.

Examples

Run this code
# NOT RUN {
n <- sample(10:15,1)
ip <- itempool(a = runif(n, .5, 2), b = rnorm(n), c = runif(n, 0, .3), D = 1)
plot(ip)
# Additional arguments will passed to geom_line
plot(ip, size = .25, alpha = 0.3)
# Test Characteristic Curve
plot(ip, tcc = TRUE)
# Proportion correct for test characteristic curve
plot(ip, tcc = TRUE, tcc_prop_corr = TRUE)
# # Remove the legend altogether
# plot(ip, suppress_plot = TRUE) + theme(legend.position="none")
# # Change the labels:
# plot(ip, suppress_plot = TRUE) + ylab("Probability") + xlab("Ability Score")
# }

Run the code above in your browser using DataLab