tests/testthat/test-diff_theta.R

test_that("difference computes the difference between theta and estimated theta", {
  # Simulate person and item parameters
  starting_theta = rnorm(1000)
  b <- runif(100, -3, 3)
  a <- runif(100, 0.6, 2)
  parameters <- data.frame(b, a)
  # simulate data
  data <- sirt::sim.raschtype(starting_theta, b = b, fixed.a = a)
  stf <- uip(data, starting_theta = starting_theta, item_par = parameters, num_item = 5)
  my_diff <- diff_theta(stf)
  expect_true(ncol(my_diff)== 4)
})

Try the shortIRT package in your browser

Any scripts or data that you put into this service are public.

shortIRT documentation built on Sept. 9, 2025, 5:33 p.m.