Free time & chunking modeling
  • Versions
    • Latest
    • v0.1
  • Source Code
  • Report a Bug
  1. Notebooks
  2. Data
  3. Subject-level data
  • 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
  1. Notebooks
  2. Data
  3. Subject-level data

Subject-level data

  • Show All Code
  • Hide All Code

  • View Source
Code
library(tidyverse)
library(targets)
tar_source()
tar_load(c(exp1_data, exp2_data))

Aggregate data at the subject level

Code
data_agg_subj <- bind_rows(
  mutate(exp1_data, exp = "Exp 1"),
  mutate(exp2_data, exp = "Exp 2")
) |>
  group_by(id, exp) |>
  nest() |>
  mutate(data = map(data, aggregate_data)) |>
  unnest(data)

Plot data for each subject

Code
data_agg_subj |>
  mutate(gap = as.factor(gap)) |>
  ggplot(aes(gap, p_correct, color = chunk, group = interaction(chunk, id))) +
  geom_point() +
  geom_line() +
  scale_color_discrete("1st chunk LTM?") +
  facet_grid(id ~ itemtype) +
  theme_pub()

Back to top
Exploratory data analysis
Main results
Source Code
---
title: "Subject-level data"
format: html
---

```{r}
#| label: init
#| message: false
library(tidyverse)
library(targets)
tar_source()
tar_load(c(exp1_data, exp2_data))
```

Aggregate data at the subject level

```{r}
#| label: aggregate_data
#| message: false
data_agg_subj <- bind_rows(
  mutate(exp1_data, exp = "Exp 1"),
  mutate(exp2_data, exp = "Exp 2")
) |>
  group_by(id, exp) |>
  nest() |>
  mutate(data = map(data, aggregate_data)) |>
  unnest(data)
```

Plot data for each subject

```{r}
#| label: joint_data
#| fig-width: 8.5
#| fig-height: 120

data_agg_subj |>
  mutate(gap = as.factor(gap)) |>
  ggplot(aes(gap, p_correct, color = chunk, group = interaction(chunk, id))) +
  geom_point() +
  geom_line() +
  scale_color_discrete("1st chunk LTM?") +
  facet_grid(id ~ itemtype) +
  theme_pub()
```