Title: | Procedures Based on Item Response Theory Models for the Development of Short Test Forms |
---|---|
Description: | Implement different Item Response Theory (IRT) based procedures for the development of static short test forms (STFs) from a test. Two main procedures are considered, specifically the typical IRT-based procedure for the development of STF, and a recently introduced procedure (Epifania, Anselmi & Robusto, 2022 <doi:10.1007/978-3-031-27781-8_7>). The procedures differ in how the most informative items are selected for the inclusion in the STF, either by considering their item information functions without considering any specific level of the latent trait (typical procedure) or by considering their informativeness with respect to specific levels of the latent trait, denoted as theta targets (the newly introduced procedure). Regarding the latter procedure, three methods are implemented for the definition of the theta targets: (i) theta targets are defined by segmenting the latent trait in equal intervals and considering the midpoint of each interval (equal interval procedure, eip), (ii) by clustering the latent trait to obtain unequal intervals and considering the centroids of the clusters as the theta targets (unequal intervals procedure, uip), and (iii) by letting the user set the specific theta targets of interest (user-defined procedure, udp). For further details on the procedure, please refer to Epifania, Anselmi & Robusto (2022) <doi:10.1007/978-3-031-27781-8_7>. |
Authors: | Ottavia M. Epifania <[email protected]> [aut, cre, cph] Pasquale Anselmi [aut, ctb] Egidio Robusto <[email protected]> [ctb] |
Maintainer: | Ottavia M. Epifania <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.3 |
Built: | 2025-02-23 03:47:00 UTC |
Source: | https://github.com/cran/shortIRT |
Create a Short Test Form (STF) using the typical IRT procedure for shortening test (Benchmark Procedure, BP)
bp(data, item_par = NULL, seed = 999, starting_theta = NULL, num_item = NULL)
bp(data, item_par = NULL, seed = 999, starting_theta = NULL, num_item = NULL)
data |
data.frame, subject |
item_par |
matrix, two-column matrix containing the item parameters. The first column must contain the difficulty parameters |
seed |
integer, define the random seed. Default is 999 |
starting_theta |
vector, define the starting |
num_item |
integer, the number of items to include in the short test form |
A list of length 5:
- item_stf: data.frame, contains the items included in the STF. The number of rows is equal to the number of items included in the STF. The -targets and the item information functions of the optimal item for each
-target are reported as well
- summary: data.frame, contains the list of items included in the STF and the test information on both the full-length test and the STF
- info_stf: list, contains the item information functions of the STF
- info_full: list, contains the item information functions of the full-length test
- theta: data.frame, contains the starting and the
estimated with the STF
# 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 <- bp(data, starting_theta = true_theta, item_par = parameters, num_item = 5) # check the obtained short test form stf$item_stf # check the comparison between the short test form and the full-length test stf$summary
# 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 <- bp(data, starting_theta = true_theta, item_par = parameters, num_item = 5) # check the obtained short test form stf$item_stf # check the comparison between the short test form and the full-length test stf$summary
Change the columns names of a data frame and stores the original column names
change_names(data)
change_names(data)
data |
data.frame, A data frame |
A list of length two:
1. a data frame with the original column names and the corresponding new names
2. a data frame with the changed column names
# original data frame with 5 columns data <- data.frame(matrix(1:20, nrow = 4, ncol = 5)) change_names(data)
# original data frame with 5 columns data <- data.frame(matrix(1:20, nrow = 4, ncol = 5)) change_names(data)
Extract the limits of the intervals obtained from sub setting a vector
cut_borders(x)
cut_borders(x)
x |
numeric/integer vector |
A data frame with two columns. The first column contains the lower bounds of each interval. The second column contains the upper bound of each interval
x <- seq(-3, 3, length = 5) groups <- cut(x, 5, include.lowest = TRUE) boundaries <- cut_borders(groups)
x <- seq(-3, 3, length = 5) groups <- cut(x, 5, include.lowest = TRUE) boundaries <- cut_borders(groups)
sCompute the difference between a starting value of and the
estimated with the STF
diff_theta(results, starting_theta = NULL)
diff_theta(results, starting_theta = NULL)
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 |
A data frame with number of rows equal to the number of respondents and 3 columns, one with the starting/true , one with the
estimated with the STF, and the difference between the estimated
and the starting/true
# 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)
# 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)
Create a Short Test Form (STF) using the -target procedure based on the equal segmentation of the latent trait (Equal Interval Procedure, EIP)
eip( data, item_par = NULL, seed = 999, starting_theta = NULL, num_item = NULL, theta_targets = NULL )
eip( data, item_par = NULL, seed = 999, starting_theta = NULL, num_item = NULL, theta_targets = NULL )
data |
data.frame, subject |
item_par |
matrix, two-column matrix containing the item parameters. The first column must contain the difficulty parameters |
seed |
integer, define the random seed. Default is 999 |
starting_theta |
vector, define the starting |
num_item |
integer, the number of items to include in the short test form |
theta_targets |
vector, define the specific |
A list of length 5:
- item_stf: data.frame, contains the items included in the STF. The number of rows is equal to the number of items included in the STF. The -targets and the item information functions of the optimal item for each
-target are reported as well
- summary: data.frame, contains the list of items included in the STF and the test information on both the full-length test and the STF
- info_stf: list, contains the item information functions of the STF
- info_full: list, contains the item information functions of the full-length test
- theta: data.frame, contains the starting and the
estimated with the STF
# 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 <- eip(data, starting_theta = true_theta, item_par = parameters, num_item = 5) # check the obtained short test form stf$item_stf # check the comparison between the short test form and the full-length test stf$summary # Short test form with cut off values stf_cutoff <- eip(data, starting_theta = true_theta, item_par = parameters, theta_targets = rep(2, 5)) stf_cutoff$item_stf
# 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 <- eip(data, starting_theta = true_theta, item_par = parameters, num_item = 5) # check the obtained short test form stf$item_stf # check the comparison between the short test form and the full-length test stf$summary # Short test form with cut off values stf_cutoff <- eip(data, starting_theta = true_theta, item_par = parameters, theta_targets = rep(2, 5)) stf_cutoff$item_stf
sPlot the difference or the absolute difference between the starting and the
estimated with the STF as a function of different levels of the latent trait
plot_difference(difference, type = c("diff", "absolute_diff"), levels = 4)
plot_difference(difference, type = c("diff", "absolute_diff"), levels = 4)
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 |
A ggplot object
# 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)
# 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)
Plot the test information functions of the short test form (default), of the full length test or of both versions
plot_tif(results, tif = c("stf", "full", "both"))
plot_tif(results, tif = c("stf", "full", "both"))
results |
The object obtained from the stf-generating functions |
tif |
character, define the TIF to plot, either "stf" (TIF of the STF), "full", (TIF of the full-length test) or "both" (TIF of both STF and full-length test). Default is "stf" |
A ggplot object
# 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) # plot the test information function of the full-length test plot_tif(stf, tif = "full") # plot the test information of the full-length test and of the short test form plot_tif(stf, tif = "both")
# 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) # plot the test information function of the full-length test plot_tif(stf, tif = "full") # plot the test information of the full-length test and of the short test form plot_tif(stf, tif = "both")
Create a Short Test Form (STF) using the -target procedure based on the unequal segmentation of the latent trait (Unequal Interval Procedure, EIP)
uip(data, item_par = NULL, seed = 999, starting_theta = NULL, num_item = NULL)
uip(data, item_par = NULL, seed = 999, starting_theta = NULL, num_item = NULL)
data |
data.frame, subject |
item_par |
matrix, two-column matrix containing the item parameters. The first column must contain the difficulty parameters |
seed |
integer, define the random seed. Default is 999 |
starting_theta |
vector, define the starting |
num_item |
integer, the number of items to include in the short test form |
A list of length 5:
- item_stf: data.frame, contains the items included in the STF. The number of rows is equal to the number of items included in the STF. The -targets and the item information functions of the optimal item for each
-target are reported as well
- summary: data.frame, contains the list of items included in the STF and the test information on both the full-length test and the STF
- info_stf: list, contains the item information functions of the STF
- info_full: list, contains the item information functions of the full-length test
- theta: data.frame, contains the starting and the
estimated with the STF
# 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 = uip(data, starting_theta = true_theta, item_par = parameters, num_item = 10) # check the obtained short test form stf_uip$item_stf # check the comparison between the short test form and the full-length test stf_uip$summary
# 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 = uip(data, starting_theta = true_theta, item_par = parameters, num_item = 10) # check the obtained short test form stf_uip$item_stf # check the comparison between the short test form and the full-length test stf_uip$summary