plot.ks_output {irt}R Documentation

Plot Item Fit using Kernel-Smoothing

Description

Plot Item Fit using Kernel-Smoothing

Usage

## S3 method for class 'ks_output'
plot(
  x,
  item_no,
  ip = NULL,
  title = "",
  ci = 0.95,
  base_r_graph = FALSE,
  suppress_plot = FALSE,
  ...
)

Arguments

x

The output of ks() function. If this will be provided the function will run much faster.

item_no

The order (i.e. column number) of the item to be plotted.

ip

An Itempool-class or Item-class object if expected probabilities are plotted.

title

Title of the plot. If the value is NULL, the plot title will be suppressed.

ci

It is either a number indicating the confidence interval that will be plotted around the item fit line or NULL if no confidence interval should be plotted. The default value is 0.95, i.e. 95 interval will be plotted.

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.

suppress_plot

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

...

further arguments.

Author(s)

Emre Gonulates

Examples

# Generate responses
ip <- generate_ip()
resp <- sim_resp(ip = ip, theta = rnorm(500), prop_missing = .2)
# Run kernel smoothing
ks_data <- ks(resp)
# Plot first item
plot(ks_data, item_no = 1)
# Plot second item with expected probability value
plot(ks_data, item_no = 2, ip = ip)

plot(ks_data, item = 2, ip = ip[[2]])

[Package irt version 0.2.9 Index]