We will create data for 60 fictional participants.
- Working-memory scores range from 0 to 100.
- Attention scores range from 0 to 100.
- Each row represents one fictional participant.
These data are simulated for learning purposes. They are not measurements from real people.
library(ggplot2)
library(plotly)
set.seed(301)
n <- 60
working_memory <- round(
pmin(pmax(rnorm(n, mean = 70, sd = 12), 30), 100)
)
attention <- round(
pmin(pmax(
70 + 0.55 * (working_memory - 70) +
rnorm(n, mean = 0, sd = 10),
30
), 100)
)
cognitive_data <- data.frame(
participant = 1:n,
working_memory = working_memory,
attention = attention
)
head(cognitive_data)
## participant working_memory attention
## 1 1 73 84
## 2 2 36 51
## 3 3 73 71
## 4 4 75 75
## 5 5 68 46
## 6 6 78 83