plot_resp_loglik: Plot the Log-Likelihood of a response string

Description Usage Arguments Value To-do Author(s) Examples

View source: R/plot_resp_loglik.R

Description

plot_resp_loglik plots the log-likelihood of a response string.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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

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

Author(s)

Emre Gonulates

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)

irt documentation built on Nov. 9, 2021, 9:07 a.m.