scdbayes: Bayesian single-case design analysis

Demo: small data only (up to 15 cases, 1,000 rows, 50 columns, 2 MB); no identifiable data. The full R package is released after validation; request early access .
scdbayes logo

R CMD Check Project Status: Active License: GPL-3

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

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

  1. Data: upload a CSV/Excel file or pick an example.
  2. Review: check the table, plots, and WWC Check.
  3. Model: confirm the design, terms, and priors.
  4. Fit: click Fit (about 1–15 minutes).
  5. Results: read diagnostics, decisions, and per-case effects.
  6. 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

Applications

Support

Author

Mikyung Shin, Ph.D.
Assistant Professor, Department of Special Education
Illinois State University

Contact

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

Descriptive between-phase summaries
Main: baseline vs last subphase.
LRR needs a ratio scale with a true zero.

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.

Bars: 95% interval for power


Export specification and results