Bayesian multilevel modeling for single-case designs using brms and Stan. Fit piecewise regression models with random effects, compute posterior-based effect sizes, and assess consistency of effects across cases. Supports AB, reversal, multiple baseline, multiple probe, alternating treatment, and changing criterion designs. Handles two- to four-level hierarchical structures for single-study and meta-analytic datasets.
Installation
The development version from GitHub with:
install.packages("devtools")
devtools::install_github("mshin77/scdbayes")
Load the scdbayes Package
library(scdbayes)
Alternatively, Launch and Browse the Shiny App
Access the web app at https://www.scdbayes.org.
Launch and browse the app on the local computer:
run_app()
Getting Started
See the Single-Case Design, Meta-Analysis, and Power Analysis articles.
Citation
-
Shin, M. (2026). scdbayes: Bayesian single-case design analysis (R package version 0.1.1) [Computer software]. https://mshin77.github.io/scdbayes
-
Shin, M. (2026). scdbayes: Bayesian single-case design analysis [Web application]. https://www.scdbayes.org
Features
Available in Both Local & Web
- AB, reversal, multiple baseline and probe designs
- Alternating treatment and changing criterion designs
- CSV/Excel upload with column detection
- Visual analysis, effect sizes, and WWC screening
- Piecewise models for continuous, count, binary, and ordinal outcomes
- Random effects, AR(1), and custom priors
- Posterior decisions per term and per case
- Diagnostics, predictive checks, and LOO comparison
- Bayesian meta-analysis and BC-SMD
- Bayesian power simulation
- Export: R script, data, effect sizes, reports
- Ask AI via Gemini
Local R Package Only
- Data beyond 15 cases or 1,000 rows
- Ask AI via OpenAI, Anthropic, or a local model
Data Format
One row per session, with these columns.
| Column | Type | Description |
|---|---|---|
case |
text/numeric | Case identifier |
time |
numeric | Session number |
phase |
text | Condition (A, B, …) |
outcome |
numeric | Measured behavior |
study |
text | Study (optional; meta-analysis) |
| moderators | text/numeric | Optional covariates |
- Phase labels: A (baseline), B (intervention), M (maintenance), G (generalization), or numbered subphases such as B1, B2, B3
- Reversal phases are numbered automatically
- Names like “participant” or “session” are detected
Quick Start
- Data: upload a CSV/Excel file or pick an example.
- Review: check the table, plots, and WWC Check.
- Model: confirm the design, terms, and priors.
- Fit: click Fit (about 1–15 minutes).
- Results: read diagnostics, decisions, and per-case effects.
- Export: download R code, data, effect sizes, and reports.
Ask AI and Co-design priors (AI) are optional and advisory. The web app uses Gemini; the R package also offers OpenAI, Anthropic, or a local model. Context sharing is off by default.
Input Validation
- Uploads: .csv, .xlsx, .xls only, size-capped
- Formulas and hypotheses: allowlist-checked
API Key Security
- Masked input, session only, never saved or logged
- Shared Gemini key: hourly and daily request limits
Network Security
- HTTPS with HSTS and security headers
Data Protection
- AI audit log: in session, exported by the user
- Restricted-use data: keep context sharing off or run locally
Infrastructure
- Docker + Caddy deployment
- Firewall, key-only SSH, security updates
Privacy
- Ask AI sends chat and instructions. Optional context excludes data rows and case IDs.
- Provider terms apply. Sharing starts off; session data and keys clear on exit.
- No usage tracking: clicks, inputs, and data are not logged
Documentation
Related Software
Applications
- R Package (full features): released after validation; request early access
- Web App (demo, small data): scdbayes.org
Support
- Email: mshin2@ilstu.edu
Author
Mikyung Shin, Ph.D.
Assistant Professor, Department of Special Education
Illinois State University
Contact
- Email: mshin2@ilstu.edu
- GitHub: github.com/mshin77
- Homepage: mshin77.net
Upload a file or select an Example Dataset to get started
Upload a file or select an Example Dataset to view variables
Continuous Variables
Categorical Variables
Upload a file or select an Example Dataset to view features
Case-Level Features
Key Feature Distributions
Upload a file or select an Example Dataset to view plots
Upload a file or select an Example Dataset to view within-phase patterns
Upload a file or select an Example Dataset to view baseline trend tests
Trend NAP compares the last three baseline points with earlier ones. NAP > 0.85 flags an already improving baseline.
Upload a file or select an Example Dataset to screen the design against the WWC 5.0 standards
WWC Screening
Experiments
Phases per Tier
Baseline Trend (risk of bias)
Reversibility (risk of bias)
Findings that meet standards proceed to effect sizes (BC-SMD, LRR, NAP/Tau) in Meta-Analysis > Export.
Upload a file or select an Example Dataset to view between-phase effect sizes
Immediacy of the Effect
Last 3 vs first 3 points per phase change; + = expected direction.
Reversibility
Initial vs later baselines; NAP <= .85 = reversible.
Percentage of Conforming Data
Share of criterion-phase points inside the acceptable range around each criterion level. The range width scales with p.
Upload data to view the processed model variables (phase-centered time, level dummies, slope-change predictors).
Model variables: time (
time_A
), level change (
level_AB
), and slope change (
trend_AB
).
Load data, choose settings, then select Fit.
Choose settings, then select Run simulation.