r-bayes

Configure brms multilevel regression with explicit priors and posterior diagnostics in R.

1|1|Updated May 5, 2026
One-click install
npx skills add https://github.com/cynkra/cynkra.ai.day --skill r-bayes-cynkra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-bayes
Source: https://github.com/cynkra/cynkra.ai.day/tree/main/claude-code-r-skills/.claude/skills/r-bayes
Command: npx skills add https://github.com/cynkra/cynkra.ai.day --skill r-bayes-cynkra

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design, fit, and interpret Bayesian regression workflows in R with brms by guiding Bayesian model setup, causal DAG validation, and effect interpretation.

Core Features & Use Cases

  • Bayesian regression with brms: Fit multilevel models with explicit priors, appropriate families, and Stan/CmdStanR backends.
  • Causal DAG support: Build and validate directed acyclic graphs using dagitty/ggdag and local conditional-independence tests.
  • Interpretable Bayesian inference: Extract posterior draws and compute odds/credible effects, posterior probability of direction, and posterior predictive checks.
  • Marginal effects & visualization: Use marginaleffects to compute AMEs and generate response-scale marginal effect plots with uncertainty.
  • Multilevel & longitudinal modeling patterns: Support random intercepts/slopes, crossed effects, person-mean centering, and lagged predictors for temporal precedence.

Quick Start

Use the r-bayes skill to fit a brms multilevel model from your prepared dataset and then compute response-scale marginal effects and posterior diagnostics.

Frequently Asked Questions about r-bayes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fit Bayesian multilevel models in R using brms with explicit priors?

Bayesian multilevel models in R use brms to configure explicit priors, family distributions, and CmdStanR backends. You define model formulas, set prior distributions, and run Stan sampling to generate posterior draws for regression analysis.

How do I compute marginal effects from a brms model on the response scale?

Compute marginal effects from brms models using marginaleffects to extract posterior draws and calculate average marginal effects (AMEs). This generates response-scale predictions with uncertainty intervals for binary, count, continuous, and ordinal outcomes.

Can I use causal DAGs to plan a Bayesian regression analysis in R?

Causal DAGs guide Bayesian regression planning by constructing directed acyclic graphs with dagitty and ggdag. You validate conditional independence relationships before fitting brms models to ensure proper causal adjustment and confounder control.

What is the best way to handle nested or repeated-measures data in Bayesian regression?

Nested and repeated-measures data in Bayesian regression use brms to specify random intercepts, random slopes, and crossed effects. You apply person-mean centering and lagged predictors to establish temporal precedence in longitudinal modeling patterns.

How do I run posterior diagnostics and interpret Bayesian regression results?

Posterior diagnostics for Bayesian regression involve extracting posterior draws to compute odds ratios, credible intervals, and probability of direction. You run posterior predictive checks to validate model fit and interpret effect estimates with uncertainty quantification.

Does brms support ordinal and count outcomes in multilevel Bayesian models?

brms supports ordinal and count outcomes in multilevel Bayesian models by selecting appropriate family distributions. You fit models with suitable sampling settings and extract posteriors to compute interpretable marginal effects across different outcome types.