Code
library(tidyverse)
library(targets)
tar_source()
tar_load(c(exp1_data, exp2_data, exp1_data_agg, exp2_data_agg))
The datafiles for the two experiments are in objects exp1_data
and exp2_data
. Let’s first look at the structure of the data for experiment 1.
id trial condition enccons serpos response duration cor chunk gap rt itemtype
1 7504 0 4 D 1 D 2576.88 1 random 3000 2.57688 SP1-3
2 7504 0 4 P 2 309.44 0 random 3000 0.30944 SP1-3
3 7504 0 4 Q 3 D 760.36 0 random 3000 0.76036 SP1-3
4 7504 0 4 J 4 D 1939.52 0 random 3000 1.93952 SP4-6
5 7504 0 4 G 5 D 3935.02 0 random 3000 3.93502 SP4-6
6 7504 0 4 W 6 W 2010.84 1 random 3000 2.01084 SP4-6
From Eda I know that the condition column is coded like this:
condition | LTM | ISI |
---|---|---|
1 | chunk | short |
2 | no-chunk | short |
3 | chunk | long |
4 | no-chunk | long |
Let’s confirm this:
condition chunk gap
1 1 known 500
2 2 random 500
3 3 known 3000
4 4 random 3000
there are this many trials per participant:
This is what the aggregated data looks like:
# A tibble: 12 × 8
chunk gap itemtype n_total n_correct p_correct ISI item_in_ltm
<chr> <dbl> <chr> <int> <dbl> <dbl> <dbl> <lgl>
1 known 500 SP1-3 1855 1715 0.925 0.5 TRUE
2 known 500 SP4-6 1858 1368 0.736 0.5 FALSE
3 known 500 SP7-9 1851 943 0.509 0.5 FALSE
4 known 3000 SP1-3 1859 1721 0.926 3 TRUE
5 known 3000 SP4-6 1858 1443 0.777 0.5 FALSE
6 known 3000 SP7-9 1856 1032 0.556 0.5 FALSE
7 random 500 SP1-3 1853 1495 0.807 0.5 FALSE
8 random 500 SP4-6 1856 1177 0.634 0.5 FALSE
9 random 500 SP7-9 1855 727 0.392 0.5 FALSE
10 random 3000 SP1-3 1856 1553 0.837 3 FALSE
11 random 3000 SP4-6 1858 1287 0.693 0.5 FALSE
12 random 3000 SP7-9 1856 838 0.452 0.5 FALSE
---
title: "View the data structure"
format:
html:
code-fold: true
---
## Overview
```{r}
#| label: init
#| message: false
library(tidyverse)
library(targets)
tar_source()
tar_load(c(exp1_data, exp2_data, exp1_data_agg, exp2_data_agg))
```
The datafiles for the two experiments are in objects `exp1_data` and `exp2_data`. Let's first look at the structure of the data for experiment 1.
```{r}
#| label: exp1_data
head(exp1_data)
```
From Eda I know that the condition column is coded like this:
| condition | LTM | ISI |
|-----------|----------|-------|
| 1 | chunk | short |
| 2 | no-chunk | short |
| 3 | chunk | long |
| 4 | no-chunk | long |
Let's confirm this:
```{r}
exp1_data |>
select(condition, chunk, gap) |>
unique() |>
arrange(condition)
```
there are this many trials per participant:
```{r}
max(as.numeric(exp1_data$trial)) + 1
```
## Aggregate data
This is what the aggregated data looks like:
```{r}
exp1_data_agg
```