Generation of rule-based matrices with the matRiks package: a tutorial

Ottavia M. Epifania, Andrea Brancaccio, Pasquale Anselmi, Debora de Chiusole

Research output: Contribution to journalArticlepeer-review

Abstract

Few resources are available for the automatic generation of Raven-like matrices. Some of them are no longer working, while others are hardly customizable without advanced programming skills. Although an R package exists for generating stimuli for psychological assessments, it currently only supports creating rotations of the same shape. The matRiks package has been developed to address the above-mentioned issues. This package generates matrices based on different types of transformation rules. Some rely on visuospatial features, such as shape, size, or orientation. Others are based on logical operations, such as set intersection or union. The package also introduces a key innovation, the automatic generation of distractors based on the common error patterns observed in Raven's tests. This allows for the construction of realistic and diagnostically meaningful response options for each matrix. Overall, the matRiks package provides a flexible and systematic framework for generating well-structured and cognitively interpretable matrix reasoning tasks, based on clearly defined transformation rules. It enables precise control over matrix complexity and supports scalable matrix creation for experimental and assessment purposes. Developed in the R environment, the matRiks package is fully open-source, facilitates the reproducibility of stimuli, and is designed to be easy to use for people with basic knowledge of the R language.
Original languageEnglish
JournalFrontiers in Psychology
Volume16
DOIs
Publication statusPublished - 28 Jan 2026

Keywords

  • fluid intelligence
  • open-source
  • R package
  • reproducibility
  • rule-based matrices

Cite this