Learn R Programming

irt (version 0.1.1)

plot_resp_loglik: 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,
  suppress_plot = FALSE,
  text_size = 12,
  ...
)

Arguments

ip

An Itempool-class class object.

resp

The response string

theta_range

The boundaries of x axis.

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.

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.

Examples

Run this code
# NOT RUN {
n <- sample(10:50,1)
ip <- itempool(data.frame(a = runif(n, .5, 2), b = rnorm(n),
                             c = runif(n, 0, .3), D = 1.7))
resp <- sim_resp(ip = ip, theta = rnorm(1))
plot_resp_loglik(ip, resp)
plot_resp_loglik(ip, resp, text_size = 9)
# Format the text of the MLE estimate
plot_resp_loglik(ip, resp, size = 3, color = 'blue')
# Suppress the MLE estimate
plot_resp_loglik(ip, resp, show_estimate = FALSE)
# }

Run the code above in your browser using DataLab