Bayesian multilevel modeling for single-case experimental 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 (ABAB), 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.0) [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, B, M, or 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. Pick Local model or a cloud provider in each window. 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 sits beside the analysis and guides each step during the session
- Context sharing is off by default; shared context has no data rows, and variable names are replaced
- Uploads, AI chat, and API keys are removed when the session ends; model files stay only in temporary server storage
- De-identified usage, never data, supports research on analysis practice. Opt out of usage tracking.
Documentation
Related Software
Applications
- R Package (full features):
devtools::install_github("mshin77/scdbayes") - Web App (demo, small data): scdbayes.org
Support
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
Upload a file or select an Example Dataset to screen the design against the WWC 5.0 standards
Upload a file or select an Example Dataset to view between-phase effect sizes
Immediacy of Effect
Mean of the last 3 points before each phase change versus the first 3 after it. Positive values favor the intervention.
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 and click Fit Model to export results
Set inputs and click Run simulation.