plot_resp_loglik: Plot the Log-Likelihood of a response string

View source: R/plot_resp_loglik.R

plot_resp_loglikR Documentation

Plot the Log-Likelihood of a response string

Description

plot_resp_loglik plots the log-likelihood of a response string.

Usage

plot_resp_loglik(
  ip,
  resp,
  theta_range = c(-5, 5),
  title = "",
  likelihood = FALSE,
  show_estimate = TRUE,
  base_r_graph = FALSE,
  suppress_plot = FALSE,
  text_size = 12,
  ...
)

Arguments

ip

An Itempool-class class object.

resp

The response string or a Response-class class object.

theta_range

Either (a) a numeric vector of length two where the values are minimum and maximum theta values, or, (b) a numeric vector of length more than two where values represents the theta values that will be plotted.

title

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

likelihood

If TRUE, likelihood function will be plotted instead of log-likelihood graph. Default value is FALSE.

show_estimate

If TRUE the maximum likelihood ability estimate will be shown. The default value is TRUE.

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.

text_size

The overall text size of the axis and titles. The default value is 12.

...

Additional arguments passed to annotate.

Value

Depending on the value of suppress_plot function either prints the Log-likelihood function of the response string or returns the plot object.

To-do

  • Make it to plot multiple test information functions. You can input a list each of which contains item parameters. And the name of the test also.

Author(s)

Emre Gonulates

Examples

## Not run: 
ip <- generate_ip(n = 9)
resp_set <- generate_resp_set(ip = ip, theta = rnorm(10))

# Plot second item's response log-likelihood function
plot_resp_loglik(ip, resp_set[[2]])

# Plot response likelihood function of second item
plot_resp_loglik(ip, resp_set[[2]], likelihood = TRUE)

# Plot using base r graphics
plot_resp_loglik(ip, resp_set[[2]], likelihood = TRUE, base_r_graph = TRUE)

# Suppress the MLE estimate
plot_resp_loglik(ip, resp_set[[4]], show_estimate = FALSE)

## End(Not run)

irt documentation built on Nov. 10, 2022, 5:50 p.m.