There are two sets of functions for each complex-span task:

`raw_`

`score_`

The `raw_`

functions will create a tidy raw data file for
the task with relevant columns for you to calculate task scores and
other performance measures on the task.

The `score_`

functions will create a scored data file for
the task from the output provided by the `raw_`

functions. To
allow for greater flexibility (see Calculating reliability below), the
`score_`

functions will need to be used with
`dplyr::group_by()`

.

`raw_`

functions`data_raw <- raw_symspan(data_import)`

Both trial and subtrial level variables are provided by the
`raw_`

functions.

A trial consists of the completion of alternating processing subtasks (e.g., symmetry judgments) and the presentation of memory items followed by a recall of the memory items.

Subtrial level performance includes the accuracy and reaction time for each individual processing subtask and the accuracy for each individual recalled memory item within a single trial.

Trial level performance includes a sum of the number of processing subtasks answered correctly on that trial and the the sum of memory items correctly recalled in their serial order. In addition, there are additional trial level scores (e.g., Partial.unit) provided to make it easier to use alternative scoring methods for the complex-span tasks. For more details on each of the scoring methods see Conway et al. (2005)

`raw_`

functions**Subject**: Subject ID column**Block**: Block number (1-3)-
**Trial**: Trial numberTrial number refers to an entire set-size sequence (alternating presentation of processing subtasks and memory items followed by the recall response)

**SetSize**: The set-size for a given trial (number of memory items presented)**MemoryTargets**: The sequence of target memory items on the trial. Re-coded in alphabet order for numeric values.**Recalled**: The sequence of recalled items. Re-coded into alphabet order for numeric values. Blank resonses shown as “-”**Processing.correct**: Sum of the number of processing subtasks answered correctly**EditDistance.unit**: Trial-level scores needed to calculate complex-span scoers based on the edit distance unit scoring method (Gonthier, 2022)**EditDistance.load**: Trial-level scores needed to calculate complex-span scoers based on the edit distance unit scoring method (Gonthier, 2022)**Partial.unit**: Trial-level scores needed to calculate complex-span scores based on the partial-credit unit scoring method.**Partial.load**: Trial-level scores needed to calculate complex-span scores based on the partial-credit load scoring method.**Absolute.unit**: Trial-level scores needed to calculate complex-span scores based on the all-or-nothing unit scoring method.**Absolute.load**: Trial-level scores needed to calculate complex-span scores based on the all-or-nothing load scoring method.-
**SubTrial**: Within a trial, there are multiple processing tasks/memory items followed by a recall responseSub-Trial refers to this sequential presentation. It also represents the order of responses made on the recall screen

**SubTrialProc**: “Processing” or “Recall” portion of the task**RT**: Reaction time**Accuracy**: Accuracy (provided for both “Processing” and “Recall”)**Response**: The subject’s response (provided for both “Processing” and “Recall”)**CorrectResponse**: The correct response (provided for both “Processing” and “Recall”)**MemoryItem**: The memory item that was presented.**keep_col**: You can specify any additional columns to be preserved in the output with`keep_col = c()`

`score_`

functionsBased on the output provided by the `raw_`

functions, the
`score_`

functions will calculate task level scores on both
the processing task and the memory task. In order to allow for more
flexibility with using the `score_`

functions, they will need
to be combined with `dplyr::group_by()`

.

```
library(englelab)
library(dplyr)
library(tidyr)
data_raw <- raw_symspan(data_import)
data_scores <- data_raw %>%
group_by(Subject) %>%
score_symspan()
## Alternatively, to get block level performance
data_scores <- data_raw %>%
group_by(Subject, Block) %>%
score_symspan() %>%
pivot_wider(id_cols = "Subject",
names_from = "Block",
names_prefix = "Block",
values_from = contains("SymSpan"))
```

`score_`

functionsFor more details on how each score is calculated see Conway et al. (2005) and Gonthier (2022)

We advise using the **PartialScore** or
**EditDistanceScore** as these tend to have the highest
reliability. If you use the Edit Distance scores, then please cite
Gontier (2022).

**Subject**: Subject ID column-
**[Task].EditDistanceScore**: Edit Distance scoring method (*sum of EditDistance.load*) (Gonthier, 2022)*i.e. SymSpan.EditDistanceScore or RotSpan.EditDistanceScore* **[Task].EditDistanceUnit**: Edit Distance unit score (*mean of EditDistance.unit*) (Gonthier, 2022)**[Task].EditDistanceLoad**: Edit Distance load score (*sum of EditDistance.load divided by Total number of memory items*) (Gonthier, 2022)**[Task].PartialScore**: Partial scoring method (*sum of Recall.correct*)**[Task].PartialUnit**: Partial-credit unit score (*mean of Partial.unit*)**[Task].PartialLoad**: Partial-credit load score (*sum of Partial.load divided by Total number of memory items*)**[Task].AbsoluteScore**: Absolute scoring method (*sum of Absolute.load*)**[Task].AbsoluteUnit**: All-or-nothing unit score (*mean of Absolute.unit*)**[Task].AbsoluteLoad**: All-or-nothing load score (*sum of Absolute.load divided by Total number of memory items*)-
**[ProcessingTask].ACC**: Average accuracy on the processing task*i.e. Symmetry.ACC or Rotation.ACC* **[ProcessingTask].RT_mean**: Average reaction time on the processing task**[ProcessingTask].RT_sd**: Standard deviation of reaction times on the processing task**[Task].Trial**: Total number of trials used to calculate the score for that row**[Task].MemoryItems**: Total number of memory items used to calculate the score for that row

Any time you use a measure of individual differences it is critical to provide reliability estimates from your sample. Here is a demonstration of how to do so with the complex-span tasks.

Reliability estimates should be calculated based on the trial level
data that was used to calculated an aggregated score for the task. For
instance, if you calculated complex-span scores using the the
partial-credit load scoring method then you should calculate reliability
based on the `Partial.load`

scores in the raw data.

```
library(englelab)
library(dplyr)
library(tidyr)
splithalf <- data_raw %>%
group_by(Subject) %>%
mutate(Split = ifelse(Trial %% 2, "odd", "even")) %>%
group_by(Subject, Split) %>%
score_symspan() %>%
pivot_wider(id_cols = "Subject",
names_from = "Split",
values_from = contains("SymSpan")) %>%
summarise(r = cor(SymSpan.PartialScore_odd, SymSpan.PartialScore_even)) %>%
mutate(r = (2 * r) / (1 + r))
```

```
library(dplyr)
library(tidyr)
library(psych) # alpha()
cronbachalpha <- data_raw %>%
distinct(Subject, Trial, .keep_all = TRUE) %>%
pivot_wider(id_cols = "Subject",
names_from = "Trial",
values_from = contains("Recall.correct")) %>%
alpha()
## The cronbach alpha value can then be accessed:
cronbachalpha$total$std.alpha
```

Conway, A. R. A., Kane, M. J., Bunting, M. F., Hambrick, Z. D., Wilhelm, O., & Engle, R. W. (2005). Working memory span tasks: A methodological review and user’s guide. Psychonomic Bulletin & Review, 12(5), 769–786.

Gonthier, C. (2022). An easy way to improve scoring of memory span tasks: The edit distance, beyond “correct recall in the correct serial position.” Behavior Research Methods, 16. https://doi.org/10.3758/s13428-022-01908-2