diff_theta {shortIRT}R Documentation

Difference between \thetas

Description

Compute the difference between a starting value of \theta and the \theta estimated with the STF

Usage

diff_theta(results, starting_theta = NULL)

Arguments

results

The object obtained from the stf-generating functions

starting_theta

vector, optional vector of length equal to the number of rows in the original data frame with the true \theta of the respondents. Default is NULL, such that the \theta estimated with the full-length test will be considered as the starting \theta

Value

A data frame with number of rows equal to the number of respondents and 3 columns, one with the starting/true \theta, one with the \theta estimated with the STF, and the difference between the estimated \theta and the starting/true \theta

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)
# without starting theta
my_diff <- diff_theta(stf)
head(my_diff)

[Package shortIRT version 0.1.3 Index]