Automatic Generation of Rule-Based Raven-Like Stimuli: The matRiks Package

Ottavia Epifania\(^{1,2}\), A. Brancaccio\(^{3}\), P. Anselmi\(^{4}\), D. de Chiusole\(^{4}\)

\(^1\) University of Trento, Rovereto (IT), \(^2\) Psicostat, Padova (IT), \(^3\) \(3\) University of East Anglia, Norwich (UK) \(4\) University of Padova, Padova (IT)

Raven-like stimuli

An example

Generative rules

Category Rule Definition
Visuospatial Completion Identification of the missing portion of a figure
Orientation Manipulation of spatial orientation
Shape Manipulation of shape
Filling Manipulation of filling
Size Manipulation of size
Pre-inference Object Addition Overlapping objects present in different cells
Object Subtraction Deleting objects present in different cells
Logic AND The third cell is obtained from the intersection of the first two
OR The third cell is obtained from the union of the first two
XOR The third cell is obtained from the union of the first two but only for the elements that do not repeat
Directional Logic Horizontal The rules are applied horizontally
Vertical The rules are applied vertically
Diagonal The rules are applied simultaneously in vertical and horizontal



\[\ldots\]

Response options

Correct

Repetition Repetition of a cell adjacent to the blank space

Incomplete Correlate Almost the correct response

Wrong Principle The correct response… for other rules!

Difference Pop-up effect, designed to be out of context

The matRiks package

It’s on CRAN!

install.packages("matRiks")
library(matRiks)


Basic functions & workflow

All functions are defined as methods for S3 classes:

mat_apply(): Matriks generator, applies transformation rules to generate a matriks

response_list(): Response options generator, given a matriks, generates the associated response list

draw(): Draw whatever it is produced by the package

flowchart LR
  A[Choose the figures] 
  B(Choose the rules)
  C(Choose the directional logic) 
  A --> D{mat_apply}
  B --> D
  C --> D
  D --> E(matriks)
  E --> F{response_list}
  E --> G{draw}
  F --> G
  G --> H[Final stimulus]

Available rules

\[\text{Size}\]

\[\text{Shape}\]

\[\text{Shade}\]

\[\text{Rotate}\]

\[\ldots\]

\[\text{AND} \, (\cap)\]

\[\text{OR} \, (\cup)\]

\[\text{XOR} \, (\Delta)\]

Available figures

draw(biscuit())
draw(pacman())
draw(malta())
draw(miley())
draw(horizontal_eight())
draw(triangle())
draw(X())
vignette("flowers-figures", package = "matRiks")

User-defined figures cof()

myfigure <- cof(luck(),
                size(biscuit(), 2),
                dot(shd="white"),
                dice(),
                name = "figure")
draw(myfigure)
1
luck() figure
2
biscuit() figure reduced in size with function size()
3
dot() figure with modified shade
4
dice() figure
5
name of the new generated figure
6
draw the figure

Response options

Category Count Items
Correct \(\times 1\) correct
Repetition \(\times 3\) r_diag, r_left, r_top
Incomplete Correlate \(\times 4\) ic_neg, ic_flip, ic_size, ic_inc
Wrong Principle \(\times 2\) wp_copy, wp_matrix
Difference \(\times 1\) difference

Warning

The generation of the distractors is constrained to the type of matriks and the rules applied for its generation!

Matriks generator: mat_apply()

mat <- mat_apply(pacman(),
                 hrules = "rotate", vrules = "rotate")
draw(mat,
     hide = TRUE)
1
Figure pacman()
2
Rotation rules applied both horizontally and vertically
3
Draw the matriks with hide = TRUE hiding the final cell of the matriks

Response generator: response_list()

Warning in ic_inc.matriks(obj): IC-Inc cannot be obtained with a single figure
responses <- response_list(mat)
draw(responses,
     main = TRUE)
1
The response options generator “eats” the matriks
2
The response options are drawn
3
The argument main = TRUE print the original label of the specific response option

Layering matriks: com()

mat <- mat_apply(pacman(), hrules = "rotate", vrules = "rotate")
mat1 <- mat_apply(dot(), hrules = "shade")
themat <- com(mat, mat1)
draw(themat, hide = TRUE)
1
Generate the background matriks
2
Generate the foreground matriks
3
Generate the final matriks by concatenating the two matriks
4
Draw & hide

responses <- response_list(themat)  
draw(responses,  
     main = TRUE)

Select & Rename

draw(responses,  
     distractors = c("correct", "r_left", "r_top", "wp_copy",
                                 "difference", "ic_neg", "ic_inc"),
     labels = LETTERS[1:7],
     main = TRUE)
1
Select specific stimuli
2
Assign labels
3
Print the new labels

Resources