# Run from the repository root: Rscript scripts/generate-behaviour-interpretation.R # One fixed seed; no draws are discarded or selected by their results. set.seed(27041) save_csv <- function(ds, name) { write.csv(ds, file.path("data", paste0("behaviour_", name, ".csv")), row.names = FALSE) } # Signed mean error per participant on a line-bisection task. save_csv(data.frame(participant = 1:36, error_mm = round(rnorm(36, -.35, 1.7), 2)), "bisection") # Sleep duration is observed, not assigned. RT is a participant mean. sleep_h <- round(runif(60, 5, 9), 2) save_csv(data.frame(participant = 1:60, sleep_h, rt_ms = round(325 - 11 * (sleep_h - 7) + rnorm(60, 0, 29), 1)), "sleep") # A balanced random allocation to two background sounds. sound <- sample(rep(c("Quiet", "Speech"), each = 28)) save_csv(data.frame(participant = 1:56, sound, rt_ms = round(620 + 34 * (sound == "Speech") + rnorm(56, 0, 60), 1)), "speech") # A balanced random allocation to three interfaces. interface <- sample(rep(c("Text", "Icon", "Both"), each = 30)) save_csv(data.frame(participant = 1:90, interface, time_s = round(c(Text = 35, Icon = 34, Both = 29)[interface] + rnorm(90, 0, 5), 1)), "interfaces") # Both factors are assigned at participant level. design <- expand.grid(cue = c("Neutral", "Spatial"), load = c("Low", "High"), replicate = 1:24) design <- design[sample(nrow(design)), ] rt_ms <- with(design, 510 + 75 * (load == "High") - 21 * (cue == "Spatial") - 30 * (load == "High" & cue == "Spatial") + rnorm(nrow(design), 0, 38)) save_csv(data.frame(participant = 1:nrow(design), design[c("cue", "load")], rt_ms = round(rt_ms, 1)), "search") # Two condition averages from each EEG recording, with a shared baseline. baseline <- rnorm(40, 4, 1.8) save_csv(data.frame(participant = 1:40, standard_uv = round(baseline + rnorm(40, 0, .9), 2), rare_uv = round(baseline + 1.1 + rnorm(40, 0, .9), 2)), "eeg") # Independently assigned messages, one binary response per participant. message <- sample(rep(c("Generic", "Specific"), each = 90)) save_csv(data.frame(participant = 1:180, message, completed = rbinom(180, 1, ifelse(message == "Specific", .59, .43))), "messages") # Independent draws within two recruitment strata. mode <- c("WalkCycle", "Transit", "Car") commute <- c(sample(mode, 100, TRUE, c(.45, .40, .15)), sample(mode, 100, TRUE, c(.15, .42, .43))) save_csv(data.frame(participant = 1:200, residence = rep(c("Near", "Far"), each = 100), commute), "commute") # Same observation window for everyone, with two notification settings. notice <- sample(rep(c("Off", "On"), each = 50)) save_csv(data.frame(participant = 1:100, notice, openings = rpois(100, ifelse(notice == "On", 5.5, 4))), "openings") # One allocation per class; pupils share an underlying class propensity. reminder <- sample(rep(c("Control", "Plan"), each = 20)) class_effect <- rnorm(40, 0, .75) prob <- plogis(-.5 + .9 * (reminder == "Plan") + class_effect) save_csv(data.frame(class = rep(sprintf("C%02d", 1:40), each = 15), pupil = rep(1:15, 40), reminder = rep(reminder, each = 15), submitted = rbinom(600, 1, rep(prob, each = 15))), "classes")