Discrete component groups can contain variables for manipulating items within that group. Psychstudio is capable of powerful text manipulation with variables. See manipulating text with variables for a full rundown.
Adding variables to the component group
Variables can be imported from a CSV file by clicking Import variables to import. We recommend creating your variables in a spreadsheet (Figure 1) and saving them as CSV files rather than creating them by hand. The CSV files should be in the following format:
- Header row with three columns (case insensitive):
Variable: The name of the variable.
Type: The type of the variable. See Variable type section below for details.
Strategy: The allocation strategy of the variable. See Variable strategy section below for details.
- One row for each variable containing a variable name (column A), type (column B) and strategy (column C), with the values for that variable starting in column D (and in this particular example, finishing in column K). As shown in (Figure 1), each variable contains 8 values.
Figure 1. Example variable spreadsheet
Variables come in many different types specific to the type of discrete component group they're added to. Listed below are the types that are available for each of the discrete component groups:
- text component group
- image component group
opacity: opacity of image (%)
flip-horizontal: flip image horizontally? (true, false)
flip-vertical:flip image vertically? (true, false)
flip-horizontal-vertical: flip image horizontally and veritcally? (true, false)
rotate: rotate image (degrees)
- audio component group has no variable types available.
Variables are allocated to items according to one of the following strategies
exclusive: values will only be allocated once per stimulus cycle (e.g. once a value from this variable has been allocated to an image, that value will not be available for allocation to any other image).
non-exclusive: values can be allocated zero, one or multiple times per stimulus cycle (i.e. a value from this variable can be allocated to multiple items).
Removing variables from the component group
Variables can be deleted by clicking on Delete variables.
WARNING: Deleting variables will remove:
- any trials rules containing values belonging to any of the variables deleted.