Free time & chunking modeling
  • Versions
    • Latest
    • v0.1
  • Source Code
  • Report a Bug
  1. Notebooks
  2. Data
  3. View the data structure
  • Version 0.1
  •  
  • About
  • Development notes
    • Notes
    • 2024-05-16 Meeting Notes
    • Extra primacy parameter
  • Notebooks
    • Data
      • View the data structure
      • Exploratory data analysis
      • Subject-level data
    • Model 1: Original model
      • Main results
      • Parameter identifiability
      • Sensitivity to tau
      • Experiment 3
      • Exploring model predictions
    • Model 2: Include encoding time
      • Main results
    • Model 3: Non-linear recovery
      • Explore model predictions
      • Basic fits
      • Bootstrapping data and fits for parameter uncertainty estimation
      • Extra primacy parameter
      • Linear recovery as a random variable
  • Function reference
    • Aggregate Data
    • Perform bootstrapped estimation
    • Calculate the deviance of a model
    • Get data object from a file
    • Generate a bootstrapped dataset
    • get_data function
    • Inverse Logit Transformation
    • Logit Transformation
    • Calculate the overall deviance
    • Plot Bootstrap Results
    • Plot Linear RV Recovery
    • Preprocesses the data
    • Execute an expression and save the result to a file or load the result from a file if it already exists.
    • Serial Recall Model

On this page

  • Overview
  • Aggregate data
  1. Notebooks
  2. Data
  3. View the data structure

View the data structure

  • Show All Code
  • Hide All Code

  • View Source

Overview

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.

Code
head(exp1_data)
    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:

Code
exp1_data |>
  select(condition, chunk, gap) |>
  unique() |>
  arrange(condition)
  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:

Code
max(as.numeric(exp1_data$trial)) + 1
[1] 80

Aggregate data

This is what the aggregated data looks like:

Code
exp1_data_agg
# 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      
Back to top
Playground
Exploratory data analysis
Source Code
---
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
```