Package 'shortr'

Title: Develop Concise but Comprehensive Shortened Versions of Psychometric Instruments
Description: Operationalizes the identification problem of which subset of items should be kept in the shortened version of a said psychometric instrument to best represent the set of items comprised in the original version of the said psychometric instrument.
Authors: Loïs Fournier [aut, cre] (ORCID: <https://orcid.org/0000-0001-6743-6456>), Alexandre Heeren [aut] (ORCID: <https://orcid.org/0000-0003-0553-6149>), Stéphanie Baggio [aut] (ORCID: <https://orcid.org/0000-0002-5347-5937>), Luke Clark [aut] (ORCID: <https://orcid.org/0000-0003-1103-2422>), Antonio Verdejo-García [aut] (ORCID: <https://orcid.org/0000-0001-8874-9339>), José C. Perales [aut] (ORCID: <https://orcid.org/0000-0001-5163-8811>), Joël Billieux [aut] (ORCID: <https://orcid.org/0000-0002-7388-6194>)
Maintainer: Loïs Fournier <[email protected]>
License: GPL (>= 3)
Version: 1.0.3
Built: 2026-05-14 09:22:56 UTC
Source: https://github.com/lfourni2/shortr

Help Index


Develop Concise but Comprehensive Shortened Versions of Psychometric Instruments

Description

Operationalizes the identification problem of which subset of items should be kept in the shortened version of a said psychometric instrument to best represent the set of items comprised in the original version of the said psychometric instrument.

Usage

shortr(
  n.mat,
  k,
  algorithm = base::c("brute.force", "simulated.annealing"),
  start.temp = 1,
  cool.fact = 0.999,
  stop.temp = 0.001,
  n.runs = 1000,
  seed = 5107,
  verbose = TRUE
)

Arguments

n.mat

The symmetric matrix of associations (e.g., of zero-order polychoric correlation coefficients) computed from the set of items comprised in the original version of the said psychometric instrument. Must be a symmetric matrix of numeric.

k

The number of items in the subset of items to be comprised in the shortened version of the said psychometric instrument. Must be a non-null positive integer.

algorithm

The combinatorial search algorithm. Must match either "brute.force" or "simulated.annealing". Default is "brute.force".

start.temp

The starting temperature in the simulated annealing search. Must be a non-null positive numeric lying within the interval (0, 1], and must be greater than stop.temp, the stopping temperature. Default is 1.

cool.fact

The cooling factor in the simulated annealing search. Must be a non-null positive numeric lying within the interval (0, 1). Default is 0.999.

stop.temp

The stopping temperature in the simulated annealing search. Must be a non-null positive numeric lying within the interval (0, 1), and must be less than start.temp, the starting temperature. Default is 0.001.

n.runs

The number of runs in the simulated annealing search. Must be a non-null positive integer. Default is 1000.

seed

The random number generator state for random number generation in the simulated annealing search. Must be a non-null positive integer or must match NULL. Default is 5107.

verbose

Whether information messages should be printed to the console. Must match either FALSE or TRUE. Default is TRUE.

Details

Let NN denote the indices corresponding to the set of items comprised in the original version of a said psychometric instrument, and let n=Nn = |N| denote its cardinality, with nNn \in \mathbb{N}. Let i,jNi, j \in N denote arbitrary indices. Let KNK \subset N denote the indices corresponding to the subset of items to be comprised in the shortened version of the said psychometric instrument, and let k=Kk = |K| denote its cardinality, with k{1,,n1}k \in \{1, \ldots, n-1\}. Let A=(aij)Rn×nA = (a_{ij}) \in \mathbb{R}^{n \times n} denote a symmetric matrix of associations (e.g., of zero-order polychoric correlation coefficients) computed from the set of items comprised in the original version of the said psychometric instrument, satisfying A=Aaij=ajiA = A^\top \Leftrightarrow a_{ij} = a_{ji} for all i,jNi, j \in N. Each element aija_{ij} represents an association (e.g., a zero-order polychoric correlation coefficient) between the items indexed by ii and jj. Let Kc=NKK^c = N \setminus K denote the complement of KK in NN, with Kc=nk|K^c| = n - k. The objective is to identify the subset of indices KNK \subset N of cardinality K=k|K| = k that maximizes the sum of the absolute values of the associations aija_{ij} for all iKi \in K and jKcj \in K^c. Formally, such an identification problem is expressed as follows:

maxKN,K=kiKjKcaij\max_{K \subset N, |K| = k} \sum_{i \in K} \sum_{j \in K^c} |a_{ij}|

Value

A list of two named objects pertaining to the solution to the identification problem yielded by the combinatorial search algorithm:

solution.character

A character denoting the subset of items to be comprised in the shortened version of the said psychometric instrument.

solution.numeric

A numeric denoting the sum of the absolute values of the associations between the subset of items to be comprised in the shortened version of the said psychometric instrument and the subset of items not to be comprised in the shortened version of the said psychometric instrument.

References

Fournier, L., Heeren, A., Baggio, S., Clark, L., Verdejo-García, A., Perales, J. C., & Billieux, J. (2026). shortr: Develop concise but comprehensive shortened versions of psychometric instruments (R package version 1.0.3) [Computer software]. doi:10.32614/CRAN.package.shortr

Examples

n.mat <- (
  stats::runif(n = 25^2, min = -1, max = 1) |>
  base::matrix(nrow = 25, ncol = 25) |>
  (\(m) (m + base::t(m)) / 2)() |>
  (\(m) {base::diag(m) <- 0; m})()
)

shortr::shortr(
  n.mat = n.mat,
  k = 5,
  algorithm = "brute.force"
)