Skip to contents

Getting Started

Launch the Shiny app

run_app()
Launch the scdbayes Shiny application

Data Structure Detection

Identify design, family, hierarchy, and column roles

detect_design_type()
Detect SCD design type
detect_hierarchical_structure()
Detect hierarchical structure in data
detect_hierarchy_levels()
Detect hierarchy levels in SCD data
find_case_var()
Locate the case-level grouping column by common SCED name patterns
find_cluster_var()
Locate a mid-level cluster grouping column
find_nest_var()
Detect a within-case nesting variable by name pattern then structure
find_phase_var()
Locate the phase column by common SCED name patterns
find_study_var()
Locate the study- / institution-level grouping column
find_time_var()
Locate the time column by common SCED name patterns
recommend_distribution_family()
Recommend distribution family based on outcome data
validate_scd_data()
Validate SCD data

Data Preparation

Process phases, compute case-level features, generate synthetic data

process_scd_phases()
Build piecewise regression coding for single-case design phases
consolidate_phase_indicators()
Consolidate binary phase indicator columns into a single phase column
compute_autocorrelation_features()
Lag-1 autocorrelation per phase per case
compute_case_features()
Per-case descriptive features
analyze_covariates()
Analyze continuous and categorical covariates
analyze_design_patterns()
Analyze design patterns
simulate_scd_data()
Simulate SCD data

Modeling

Bayesian piecewise model formulas, priors, and fits via brms

build_default_random_effects()
Build default random effects formula string
build_comparison_models()
Build candidate model formulas
generate_adaptive_priors()
Generate adaptive priors based on data characteristics
generate_prior_recommendations()
Generate prior recommendations
assemble_brms_priors()
Assemble brms priors from app-level inputs
link_scale_multiplier()
Scale multiplier for the link function
priors_to_brms()
Convert prior list to brms prior object
run_scd_analysis()
Main analysis function
run_model_comparison()
Model comparison via LOO-CV
run_sequential_update()
Sequential Bayesian updating
run_sensitivity_analysis()
Run sensitivity analysis with different priors and outlier handling

Diagnostics

Convergence diagnostics and variance-component bootstrap

compute_convergence_diagnostics()
Convergence diagnostics for Bayesian models
bootstrap_variance_components()
Parametric bootstrap for ICC CIs
prior_predictive_check()
Prior predictive check for a fitted SCD model

Posterior Predictive Checking

Posterior predictive checks on visual-analysis features and overlay draws

posterior_predictive_features()
Posterior predictive checks on single-case visual-analysis features
ppc_overlay_draws()
Posterior-predictive line draws for a spaghetti overlay

Posterior Decisions

Family-native posterior decision summaries, phase contrasts, and meta-analytic summary

summarize_fixed_effect_decisions()
Posterior decision summary for fixed-effect coefficients
summarize_per_case_effects()
Per-case posterior decision summary
summarize_cross_case_consistency()
Posterior probability of consistent intervention direction across cases
summarize_variance_components()
Posterior summary of variance components
compute_phase_contrast()
Posterior phase contrast on the response scale
summarize_phase_descriptives()
Pre-model descriptive phase summary
calculate_meta_summary()
Calculate meta-analytic summary statistics

Power Analysis

Simulation-based power for SCD multilevel Bayesian models

run_power_simulation()
Bayesian power and design analysis by simulation

Process Analytics

De-identified process-log events, sequences, and transition summaries

plog_event()
Construct a de-identified process-log event
plog_write()
Append a de-identified event to the store (no-op unless enabled)
plog_read()
Read the event store into a flat data frame of action rows
plog_summary()
Per-session and per-action event counts
plog_sequences()
Per-session ordered action sequences
plog_seq_matrix()
Right-padded action matrix for TraMineR sequence objects
plog_transition_matrix()
First-order Markov transition probabilities between consecutive actions
plog_time_to()
Time from a session's first event to a target action (right-censored)
plog_inter_event()
Within-session inter-event gaps in seconds

LLM Assistant

Gemini methodology and prior-elicitation dialog turns

gemini_ask()
Context-aware Gemini methodology assistant turn
gemini_dialog_turn()
Prior co-design (elicitation) Gemini dialog turn
sanitize_llm_text()
Strip control characters and cap length of user-supplied LLM text

Internal

scdbayes scdbayes-package
scdbayes: Bayesian Single-Case Design Analysis
print(<scd_analysis>)
Print method for scd_analysis objects
.match_var()
Match a column name (case-insensitive) against a pattern list