r-bayes

Fit Bayesian multilevel models with brms and visualize causal DAGs in R.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/jhelvy/dotfiles --skill r-bayes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-bayes
Source: https://github.com/jhelvy/dotfiles/tree/main/claude/skills/r-bayes
Command: npx skills add https://github.com/jhelvy/dotfiles --skill r-bayes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill streamlines Bayesian statistical modeling and causal inference in R, making complex analyses more accessible and reproducible.

Core Features & Use Cases

  • Causal DAGs: Define, validate, and visualize Directed Acyclic Graphs for causal inference.
  • Bayesian Modeling: Fit multilevel models using brms with explicit prior specification and robust diagnostics.
  • Marginal Effects: Extract and interpret model predictions and effects using marginaleffects.
  • Use Case: Analyze longitudinal survey data to understand the causal impact of an intervention, accounting for individual differences and temporal dynamics.

Quick Start

Use the r-bayes skill to fit a multilevel Bayesian model predicting outcome from predictor1 and predictor2 using the brms package.

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 with random intercepts and slopes?

You can fit Bayesian multilevel models in R using the brms package, which supports specifying random intercepts, random slopes, and within-person centering for complex longitudinal data structures.

What is the best way to define and validate Directed Acyclic Graphs for causal inference in R?

To define and validate Directed Acyclic Graphs (DAGs) in R, use dagitty and ggdag packages to visually map, test, and validate causal assumptions before estimating model effects.

How do I extract and interpret marginal effects from a brms Bayesian model?

Extract and interpret marginal effects from brms Bayesian models using the marginaleffects package to calculate predictions, visualize effects, and understand model outcomes accurately.

Can I use brms to analyze longitudinal survey data and estimate causal intervention impacts?

Yes, brms supports analyzing longitudinal survey data by estimating causal intervention impacts while accounting for individual differences and temporal dynamics via multilevel modeling.

Does fitting Bayesian models in R with brms require explicit prior specification and diagnostics?

Yes, fitting Bayesian models with brms involves explicit prior specification and robust model diagnostics to validate results, ensure reproducibility, and accurately interpret posterior distributions.