plot_empirical_icc {irt}R Documentation

Plot Empirical Item characteristic curve

Description

plot_emprical_icc plots empirical item characteristic curve. It plots observed p-values vs. expected p-values grouped into bins based theta scores (or any score supplied). Optionally, provide theta vector, otherwise examinee abilities will be estimated by est_ability(..., type = "eap"). This will slow down the plotting function.

Usage

plot_empirical_icc(
  resp,
  item,
  ip,
  theta = NULL,
  bins = 10,
  binwidth = NULL,
  title = "",
  suppress_plot = FALSE,
  base_r_graph = FALSE,
  ...
)

Arguments

resp

Response matrix.

item

The column number, column name or the 'ID' of the the item that should be plotted.

ip

An Itempool-class object that is needed for some plots.

theta

A vector of examinee abilities.

bins

An integer larger than 2 representing of ability groups examinees should be grouped into. The default is 10. The maximum value of bins + 1 is the number of possible total scores.

binwidth

This determines the width of each bin of the theta scale. Within each bin, there might be different number of examinees.

title

Title of the plot. The default value is "", where title of the plot will be "Trace Plot of <Item ID>". If the value is NULL, the plot title will be suppressed.

suppress_plot

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

base_r_graph

If TRUE function will plot graphs using base R graphics. If FALSE the function will check whether 'ggplot2' package is installed. If it is installed, it will use 'ggplot2' package for the plot. The default value is FALSE.

...

Extra parameters that will pass to geom_line.

Value

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

Author(s)

Emre Gonulates

Examples

ip <- generate_ip(model = c("3PL", "GRM"), n = 20)
true_theta <- rnorm(2000)
resp <- generate_resp_set(ip = ip, theta = true_theta)

plot_empirical_icc(resp, "Item_3", ip = ip, theta = true_theta)
plot_empirical_icc(resp, 3, ip = ip, theta = true_theta)
# Change the number of bins
plot_empirical_icc(resp, 3, ip = ip, theta = true_theta, bins = 10)
# Fixed bin width
plot_empirical_icc(resp, 3, ip = ip, theta = true_theta, binwidth = .2)

# Plot GRM item's ICC
plot_empirical_icc(resp, "Item_4", ip = ip, theta = true_theta)
plot_empirical_icc(resp, "Item_4", ip = ip, theta = true_theta, binwidth = .2)


[Package irt version 0.2.9 Index]