plot_empirical_icc2 {irt} | R Documentation |
Plot Empirical Item Characteristic Curve
Description
plot_emprical_icc
plots empirical item characteristic curve.
Examinees will be put into bins based on their total raw scores and the
proportion of examinees who correctly answered an item for each bin will be
plotted.
Usage
plot_empirical_icc2(
resp,
item,
bins = 10,
binwidth = NULL,
ip = NULL,
theta = NULL,
title = "",
suppress_plot = FALSE,
x_axis_scale = NULL,
n_dodge = 1,
...
)
Arguments
resp |
Response matrix. |
item |
The column number, column name or the 'ID' of the the item that should be plotted. |
bins |
An integer larger than 2 representing of ability groups examinees
should be grouped into. The default is |
binwidth |
If 'theta' scale is used, the |
ip |
An |
theta |
A vector of examinee abilities. |
title |
Title of the plot. The default value is |
suppress_plot |
If |
x_axis_scale |
Set the scale of the x-axis. The default value is
|
n_dodge |
The number of lines the x-axis tick labels should be written
to. This is especially useful if the x-axis tick labels overlap with each
other. The default value is |
... |
Extra parameters that will pass to |
Value
Depending on the value of suppress_plot
function either prints
the empirical item or test 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 <- sim_resp(ip = ip, theta = true_theta)
# Provide item ID
plot_empirical_icc2(resp = resp, item = "Item_5")
# Provide item number
plot_empirical_icc2(resp, item = 3)
# Change x-axis scale
plot_empirical_icc2(resp, item = 3, x_axis_scale = "number")
# Change number of bins and x-axis scale
plot_empirical_icc2(resp, item = 3, bins = 11, x_axis_scale = "theta")
# Use bin width
plot_empirical_icc2(resp, item = 3, binwidth = 2)
# Use theta scores instead of raw scores
plot_empirical_icc2(resp, item = 3, binwidth = .2, ip = ip,
theta = true_theta)
# A GRM item
plot_empirical_icc2(resp, item = 4)
plot_empirical_icc2(resp, item = 4, x_axis_scale = "percent")
plot_empirical_icc2(resp, item = 4, x_axis_scale = "number")
plot_empirical_icc2(resp, item = 4, binwidth = 4)
# Use raw score and custom binwidth
plot_empirical_icc2(resp, item = 4, x_axis_scale = "percent", binwidth = 4)
# Use theta score
plot_empirical_icc2(resp, item = 4, binwidth = .2, ip = ip,
theta = true_theta)
# Add arguments for 'geom_line'
plot_empirical_icc2(resp, item = 4, binwidth = .2, ip = ip,
theta = true_theta, size = 1, alpha = .25)