plot_difference {shortIRT} | R Documentation |
Plot the difference between \theta
s
Description
Plot the difference or the absolute difference between the starting \theta
and the \theta
estimated with the STF as a function of different levels of the latent trait
Usage
plot_difference(difference, type = c("diff", "absolute_diff"), levels = 4)
Arguments
difference |
data.frame, data frame obtained with the function [diff_theta()] |
type |
character, type of difference, either as is ("diff") or absolute ("absolute_diff"). Default is "diff". |
levels |
integer, number of levels of the starting |
Value
A ggplot object
Examples
# set a seed to replicate the results
set.seed(999)
# Simulate person and item parameters
true_theta <- rnorm(1000)
b <- runif(30, -3, 3)
a <- runif(30, 0.6, 2)
parameters <- data.frame(b, a)
# simulate data
data <- sirt::sim.raschtype(true_theta, b = b, fixed.a = a)
stf <- uip(data, starting_theta = true_theta, item_par = parameters, num_item = 5)
# compute the difference between starting theta and that estimated with the stf
my_diff <- diff_theta(stf)
# plot the difference with default number of levels
plot_difference(my_diff, type = "diff")
# plot the absolute difference with 10 levels
plot_difference(my_diff, type = "absolute_diff", levels = 10)
[Package shortIRT version 0.1.3 Index]