Learn R Programming

irt (version 0.1.1)

plot_empirical_icc: Plot Empirical Item or Test characteristic curve

Description

plot_emprical_icc plots empirical item or test characteristic curve.

Usage

plot_empirical_icc(
  resp,
  item,
  type = "eicc",
  bins = 10,
  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.

type

The type of the graph that will be plotted.

"eicc"

Plot 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.

"oep"

Plot Observed p-values vs. expected p-values grouped into bins based on total raw scores or theta scores. This plot requires an Itempool-class object. Optionally, provide theta vector, otherwise examinee abilities will be estimated by est_ability(..., type = "eap"). This will slow down the plotting function.

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.

ip

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

theta

A vector of examinee abilities.

title

Title of the plot

suppress_plot

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

x_axis_scale

Set the scale of the x-axis. The default value is NULL. For total score it will be defaulted to "percent".

"percent"

Percent interval.

"number"

Numbers between 1 and bins

"theta"

Theta values equally divided into bins. the middle value of the bin is shown in the x-axis. For example, if bins = 10, the first tick of the x-axis will be the mean of minimum theta value and 10th percentile theta value.

This is the only option for type = "oep".

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 1, which means all of the labels are written on the same line.

...

Extra parameters that will pass to geom_line.

Value

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

Examples

Run this code
# NOT RUN {
# Plot the information function of an item
resp <- sim_resp(ip = generate_ip(model = "3PL", n = 20),
                 theta = rnorm(10000))
plot_empirical_icc(resp, 3)
# Change the number of bins
plot_empirical_icc(resp, 4, bins = 15)

# }

Run the code above in your browser using DataLab