Title: | Item Maker |
---|---|
Description: | This is an Automatic Item Generator for Psychological Assessment. Items created with the 'IMak' package should not be used in applied settings as part of the working protocol without ensuring first that the items meet the required psychometric quality standards (see Blum & Holling, 2018) <DOI:10.3389/fpsyg.2018.01286>. |
Authors: | Diego Blum [aut, cre] |
Maintainer: | Diego Blum <[email protected]> |
License: | GPL-3 |
Version: | 2.1.0 |
Built: | 2025-03-10 05:04:39 UTC |
Source: | https://github.com/cran/IMak |
Creates an analogy item from pre-made stimuli, the latter being either figural or verbal.
To create figural analogies from stimuli generated by IMak, the
build_fa
and plot_fa
functions should be used.
afs( path, type = "F", sa, sb, sc, s1 = "No content", s2 = "No content", s3 = "No content", s4 = "No content", s5 = "No content", s6 = "No content", s7 = "No content", s8 = "No content", s9 = "No content", s10 = "No content", relations = "A", question = T, labels = "L", ai.idn = F, size.arrow = 34, size.arrowhead = 3, size.colon = 55, size.relword = 32, size.q = 85, size.word = 32, size.label = 25, language = "E", out = "item" )
afs( path, type = "F", sa, sb, sc, s1 = "No content", s2 = "No content", s3 = "No content", s4 = "No content", s5 = "No content", s6 = "No content", s7 = "No content", s8 = "No content", s9 = "No content", s10 = "No content", relations = "A", question = T, labels = "L", ai.idn = F, size.arrow = 34, size.arrowhead = 3, size.colon = 55, size.relword = 32, size.q = 85, size.word = 32, size.label = 25, language = "E", out = "item" )
path |
Directory where files are saved and/or collected. For example: |
type |
Should the |
sa |
String with stimulus name A of an A:B::C:D analogy, including ".png" extension when |
sb |
String with stimulus name B of an A:B::C:D analogy, including ".png" extension when |
sc |
String with stimulus name C of an A:B::C:D analogy, including ".png" extension when |
s1 |
String with response option name 1, including ".png" extension when |
s2 |
String with response option name 2, including ".png" extension when |
s3 |
String with response option name 3, including ".png" extension when |
s4 |
String with response option name 4, including ".png" extension when |
s5 |
String with response option name 5, including ".png" extension when |
s6 |
String with response option name 6, including ".png" extension when |
s7 |
String with response option name 7, including ".png" extension when |
s8 |
String with response option name 8, including ".png" extension when |
s9 |
String with response option name 9, including ".png" extension when |
s10 |
String with response option name 10, including ".png" extension when |
relations |
Should analogical relations be indicated by arrows and a colon ( |
question |
Should there be a question mark? |
labels |
Should options be labeled by letters ( |
ai.idn |
Should there be "All incorrect" and "I don't know" options? |
size.arrow |
Thickness of the arrow. |
size.arrowhead |
Size of the arrowhead. |
size.colon |
Size of the colon. |
size.relword |
Size of words that relate the stimuli of the A:B::C:D stem to each other. |
size.q |
Size of the question mark. |
size.word |
Size of verbal stimuli excluding labels and words of the stem (for these two, use |
size.label |
Size of labels. |
language |
Language of verbal stimuli including words of the stem. |
out |
Output file name. |
Create an analogy item by using pre-made stimuli. Such stimuli can be either figural or
verbal, and it should be sufficient to complete the A, B and C terms of an A:B::C:D analogy stem
plus at least two answer options. Use a source/target folder to save the item by providing an
argument to path
. For a figural item, save the pre-made figures as PNG files inside that folder
(the ideal would be to supply perfect-square high-resolution images).
Give arguments to sa
, sb
and sc
, thus indicating the names of stimuli A, B and C.
Give arguments to s1
and s2
to indicate the names of two answer options. Provide further arguments
to parameters s3
to s10
if you would like to add up to 10 options in total. All of these
names are the image file names plus their ".png" extensions when you want to create a figural item.
Include "All incorrect" and "I don't know" options by setting ai.idn
to TRUE
. Other variables
that can be altered are: the way of indicating the A:B::C:D relations, the question mark,
the option labels, the sizes and the language of verbal stimuli.
A PNG file containing the item.
Diego Blum [email protected]
build_fa
generates the information of figural analogies
that can be read by plot_fa
.
build_fa( isomorphs = 1, main.rot = c(0, 0), mirror = 0, trap.rot = c(0, 0), subtract = c(0, 0), dot.mov = c(0, 0), a.main = "R", a.flip = "R", a.trap = "R", a.dot = "R", constrict = F, al.main.rot = 0, al.mirror = 0, al.trap.rot = 0, al.subtract = 0, al.dot.mov = 0, correct = 0, add.rule = 0, automatic = T )
build_fa( isomorphs = 1, main.rot = c(0, 0), mirror = 0, trap.rot = c(0, 0), subtract = c(0, 0), dot.mov = c(0, 0), a.main = "R", a.flip = "R", a.trap = "R", a.dot = "R", constrict = F, al.main.rot = 0, al.mirror = 0, al.trap.rot = 0, al.subtract = 0, al.dot.mov = 0, correct = 0, add.rule = 0, automatic = T )
isomorphs |
A number of isomorphic items to be developed. |
main.rot |
A numeric vector with two main shape rotation values multiple of 45 and between -135 and 180. No rotation: 0. |
mirror |
A number designating the presence of shape reflection or no reflection (i.e., 1 or 0). |
trap.rot |
A numeric vector with two trapezium rotation values multiple of 45 and between -135 and 180. No rotation: 0. |
subtract |
A numeric vector with two line segments of the main shape to subtract from 1 to 5, or letter |
dot.mov |
A numeric vector with two dot edge movement amounts, with a maximum of 5 movements in total. No dot edge movement: 0. |
a.main |
A numeric vector with possible rotation states of the main shape of Figure A from 1 to 8. Random by default. |
a.flip |
A logical value designating whether Figure A is flipped with respect to its vertical axis or not (i.e., |
a.trap |
A numeric vector with possible rotation states of the trapezium of Figure A from 1 to 8. Random by default. |
a.dot |
A numeric vector with possible dot positions in Figure A from 1 to 6. Random by default. |
constrict |
A character string designating a part of Figure A to display all possible positions every 'n' isomorphs. |
al.main.rot |
A numeric vector with alternative main shape rotation solutions. Random by default. |
al.mirror |
A numeric vector with alternative reflection solutions. Random by default. |
al.trap.rot |
A numeric vector with alternative trapezium rotation solutions. Random by default. |
al.subtract |
A numeric vector with alternative subtraction solutions. Random by default. |
al.dot.mov |
A numeric vector with alternative dot edge movement solutions. Random by default. |
correct |
A vector with numbers ranging from 1 to 9 for correct response placements. Random by default. |
add.rule |
A number specifying which rule from 1 to 5 adds itself to the options of one-rule-based items. Random by default. |
automatic |
Should options be generated by the program? True by default. |
Thorough information about the build_fa
function can be found in the cited
research paper of Blum and Holling (2018). Make sure to read the PDF version of it,
since it is clearer. Additional information can also be found on icar-project.com.
An object of class 'fa_items'
, basically a list including elements to be plotted with function plot_fa
.
Diego Blum [email protected]
Blum, D., & Holling, H. (2018). Automatic generation of figural analogies with the IMak package. Frontiers in psychology, 9(1286), 1-13. <DOI:10.3389/fpsyg.2018.01286>
## For plotting options, see the plot_fa examples. ## Create two isomorphs with one rule and set the correct answer to 1: one <- build_fa(isomorphs = 2, dot.mov = c(1, 2), correct = 1) ## Create four isomorphs with two rules: two <- build_fa(isomorphs = 4, main.rot = c(180, 135), trap.rot = c(90, 45)) ## Create 20 isomorphs with three rules. Set automatic = FALSE and affect the options: three <- build_fa(isomorphs = 20, mirror = 1, trap.rot = c(90, 45), dot.mov = c(1, 2), automatic = FALSE, al.mirror = c(0, 1), al.trap.rot = -45, al.dot.mov = 1) ## Create four two-rule-based isomorphs, all of them comprising the same Figure A: four <- build_fa(isomorphs = 4, a.main = 1, a.flip = FALSE, a.trap = 2, a.dot = 6, mirror = 1, subtract = "R") ## Create 16 isomorphs by constricting the main shape rotation rule: five <- build_fa(isomorphs = 16, subtract = c(1, 4), constrict = "main")
## For plotting options, see the plot_fa examples. ## Create two isomorphs with one rule and set the correct answer to 1: one <- build_fa(isomorphs = 2, dot.mov = c(1, 2), correct = 1) ## Create four isomorphs with two rules: two <- build_fa(isomorphs = 4, main.rot = c(180, 135), trap.rot = c(90, 45)) ## Create 20 isomorphs with three rules. Set automatic = FALSE and affect the options: three <- build_fa(isomorphs = 20, mirror = 1, trap.rot = c(90, 45), dot.mov = c(1, 2), automatic = FALSE, al.mirror = c(0, 1), al.trap.rot = -45, al.dot.mov = 1) ## Create four two-rule-based isomorphs, all of them comprising the same Figure A: four <- build_fa(isomorphs = 4, a.main = 1, a.flip = FALSE, a.trap = 2, a.dot = 6, mirror = 1, subtract = "R") ## Create 16 isomorphs by constricting the main shape rotation rule: five <- build_fa(isomorphs = 16, subtract = c(1, 4), constrict = "main")
plot_fa
plots figural analogies by reading the
information previously stored in an object of class 'fa_items'
generated with build_fa
.
plot_fa( items, which = 0, mode = "A", language = "E", language.dir = "A", form.int = "A", form.ext = "A", size.shape = 1, size.dot = 2, size.line = 1, size.q = 3.5, size.word = 1.2, info = T, sep = ",", directory = F, switch.from = 0, switch.to = 0 )
plot_fa( items, which = 0, mode = "A", language = "E", language.dir = "A", form.int = "A", form.ext = "A", size.shape = 1, size.dot = 2, size.line = 1, size.q = 3.5, size.word = 1.2, info = T, sep = ",", directory = F, switch.from = 0, switch.to = 0 )
items |
An object of class |
which |
A numeric vector designating which isomorph(s) to plot. Plot all by default. |
mode |
A character string designating plot mode |
language |
A character string designating English ( |
language.dir |
A character string designating language for output files. |
form.int |
A character string designating the form from |
form.ext |
A character string designating the form from |
size.shape |
A number designating the size of every shape. Default is 1. |
size.dot |
A number designating the size of every shape dot. Default is 2. |
size.line |
A number designating the thickness of every shape. Default is 1. |
size.q |
A number designating the size of the question mark. Default is 3.5. |
size.word |
A number designating the size of the verbal options. Default is 1.2. |
info |
Should the applied rules and correct answers be informed? True by default. |
sep |
Field separator character of the "Info.csv" file. The default |
directory |
A character string designating a folder in your PC where to store the isomorphs. |
switch.from |
Number 'p' designating an option from 1 to 8 to switch with 'q'. |
switch.to |
Number 'q' designating an option from 1 to 8 to switch with 'p'. |
Thorough information about the plot_fa
function can be found in the cited
research paper of Blum and Holling (2018). Make sure to read the PDF version of it,
since it is clearer. Additional information can also be found on icar-project.com.
A data frame containing rules applied and right answers when info = T
by default, or an object of class 'fa_items'
when which
has length 1, its value is greater than 0 and both switch.from
and switch.to
are greater than 0.
Diego Blum [email protected]
Blum, D., & Holling, H. (2018). Automatic generation of figural analogies with the IMak package. Frontiers in psychology, 9(1286), 1-13. <DOI:10.3389/fpsyg.2018.01286>
## Create two isomorphs with one rule and set the correct answer to 1: one <- build_fa(isomorphs = 2, dot.mov = c(1, 2), correct = 1) ## Plot them: plot_fa(one) ## Change the correct answer of item 2 from position 1 to position 2: one <- plot_fa(one, which = 2, switch.from = 1, switch.to = 2) ## Choose a directory and save the items: # dir1 <- "enter your new directory here" # plot_fa(one, directory = dir1) ## Create four isomorphs with two rules: two <- build_fa(isomorphs = 4, mirror = 1, trap.rot = c(90, 45)) ## Plot them in German language: plot_fa(two, language = "D") ## Plot only items 2 and 3 in Spanish and choose form "B" for the internal main shape: plot_fa(two, language = "S", form.int = "B", which = c(2, 3)) ## Choose a different directory and save these two items by keeping the latter configuration: # dir2 <- "enter your new directory here" # plot_fa(two, which = c(2, 3), language.dir = "S", form.int = "B", directory = dir2) ## Create 20 isomorphs with three rules. Set automatic = FALSE and affect the options: three <- build_fa(isomorphs = 20, mirror = 1, trap.rot = c(90, 45), dot.mov = c(1, 2), automatic = FALSE, al.mirror = c(0, 1), al.trap.rot = -45, al.dot.mov = 1) ## Plot them: plot_fa(three) ## Plot each individual shape of item 13 in German language only: plot_fa(three, which = 13, mode = "C", language = "D") ## Save the item parts in a different folder. Re-import them to create and save another plot: # dir3 <- "enter your new directory here" # plot_fa(three, which = 13, mode = "C", language.dir = "D", directory = dir3) # afs(sa = "item13a.png", sb = "item13b.png", sc = "item13c.png", # s1 = "item13op1.png", s2 = "item13op2.png", s3 = "item13op3.png", # s4 = "item13op4.png", s5 = "item13op5.png", s6 = "item13op6.png", # s7 = "item13op7.png", s8 = "item13op8.png", ai.idn = T, path = dir3)
## Create two isomorphs with one rule and set the correct answer to 1: one <- build_fa(isomorphs = 2, dot.mov = c(1, 2), correct = 1) ## Plot them: plot_fa(one) ## Change the correct answer of item 2 from position 1 to position 2: one <- plot_fa(one, which = 2, switch.from = 1, switch.to = 2) ## Choose a directory and save the items: # dir1 <- "enter your new directory here" # plot_fa(one, directory = dir1) ## Create four isomorphs with two rules: two <- build_fa(isomorphs = 4, mirror = 1, trap.rot = c(90, 45)) ## Plot them in German language: plot_fa(two, language = "D") ## Plot only items 2 and 3 in Spanish and choose form "B" for the internal main shape: plot_fa(two, language = "S", form.int = "B", which = c(2, 3)) ## Choose a different directory and save these two items by keeping the latter configuration: # dir2 <- "enter your new directory here" # plot_fa(two, which = c(2, 3), language.dir = "S", form.int = "B", directory = dir2) ## Create 20 isomorphs with three rules. Set automatic = FALSE and affect the options: three <- build_fa(isomorphs = 20, mirror = 1, trap.rot = c(90, 45), dot.mov = c(1, 2), automatic = FALSE, al.mirror = c(0, 1), al.trap.rot = -45, al.dot.mov = 1) ## Plot them: plot_fa(three) ## Plot each individual shape of item 13 in German language only: plot_fa(three, which = 13, mode = "C", language = "D") ## Save the item parts in a different folder. Re-import them to create and save another plot: # dir3 <- "enter your new directory here" # plot_fa(three, which = 13, mode = "C", language.dir = "D", directory = dir3) # afs(sa = "item13a.png", sb = "item13b.png", sc = "item13c.png", # s1 = "item13op1.png", s2 = "item13op2.png", s3 = "item13op3.png", # s4 = "item13op4.png", s5 = "item13op5.png", s6 = "item13op6.png", # s7 = "item13op7.png", s8 = "item13op8.png", ai.idn = T, path = dir3)