R simulations & analysis comparing the classic SM-2 scheduler with a cognitive-loadβadaptive variant.
This project implements two spaced-repetition schedulers in R:
- SM-2 (SuperMemo-2): the standard ease-factor algorithm
- CLoad: an adaptive variant that adjusts intervals based on simulated βcognitive loadβ
We run synthetic cohort simulations (N users Γ M cards) and analyze:
- Day-8 recall accuracy (t-test & Cohenβs d)
- Learning curves over days (mixed-ANOVA)
- Self-efficacy pre/post comparisons
- Retention curves (ggplot2)
βββ README.md
βββ remindXR-study.Rproj
βββ data/
β βββ cards.csv
β βββ day8.csv
β βββ pt.csv
β βββ logs.csv
β βββ selfeff.csv
β βββ def_pt.rds
β βββ all_analysis_data.RData
βββ R/
β βββ schedulers.R # SM-2 & CLoad functions
β βββ simulate_cohort.R # simulate_study() wrapper
βββ analysis/
β βββ analysis.Rmd # statistical tests & plots
β βββ analysis.html # knitted output
- R (β₯ 4.0)
- RStudio (recommended)
- Required packages:
install.packages(c( "dplyr", "magrittr", "simstudy", "knitr", "rmarkdown", "ggplot2", "lme4", "effsize" ))
-
Open the project file
remindXR-study.Rprojin RStudio. -
Source the scheduler functions and simulate:
source("R/schedulers.R") source("R/simulate_cohort.R") cards_df <- read.csv("data/cards.csv") logs <- simulate_study(cards_df, days = c(0,1,3,5,7,8)) head(logs)
- In the analysis/ directory, open analysis.Rmd.
- Knit to HTML or PDF to reproduce all:
- Day-8 t-test & Cohen's d
- Mixed-ANOVA on accuracy trends
- Self-efficacy pre/post Wilcoxon test
- Retention curves (ggplot2)
- View the finished report at
analysis/analysis.html
- cards.csv: initial deck definitions
- day8.csv: summary recall percentages
- logs.csv: long-form review logs (all days)
- selfeff.csv: self-efficacy pre/post data
- pt.csv: participant metadata
- def_pt.rds, all_analysis_data.RData: serialized R objects for quick load
- R/schedulers.R:
sm2(ease, q, interval_prev)cload(ease, q, load, interval_prev)
- R/simulate_cohort.R:
simulate_study(cards_df, days)drives the day-by-day review loop
- analysis/analysis.Rmd:
- Organize code chunks for reproducible figures and tables
This work is licensed under the MIT License. For details, see the LICENSE.