r-bayes

Run Bayesian regression models and validate causal DAGs in R.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires brms, cmdstanr, dagitty, ggdag, marginaleffects, tidybayes, bayesplot, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides tools for Bayesian inference, causal graph validation, and effect estimation in R, simplifying complex statistical workflows.

Core Features & Use Cases

  • Bayesian Regression Modeling: Configure and run multilevel models with specified priors using brms and cmdstanr.
  • Causal DAG Validation: Create, visualize, and validate causal graphs to inform model specification and causal inference.
  • Effect Size Estimation: Extract and interpret posterior distributions, odds ratios, and marginal effects for a variety of data types and research questions.
  • Use Case: Researchers can model treatment effects with random effects, validate causal assumptions with DAGs, and generate understandable summaries and plots for publication.

Quick Start

Use the r-bayes skill to run a Bayesian logistic regression with a random intercept, interpret the model’s effects, and visualize the posterior distributions.

Frequently Asked Questions about r-bayes

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

FAQPage Schema
How do I perform Bayesian causal inference and validate causal assumptions in R?

Bayesian causal inference requires structuring effect estimation through DAG validation and posterior visualization. You can use R packages like brms and dagitty to validate causal graphs, configure multilevel models with specified priors, and interpret effect sizes for complex data analysis.

How do I estimate marginal effects and odds ratios from posterior distributions?

To estimate marginal effects and odds ratios from posterior distributions, extract and interpret the model outputs using packages like marginaleffects and tidybayes. This approach simplifies generating understandable summaries and publication-ready plots from Bayesian regression models.

Can I use cmdstanr and brms to configure multilevel models with random effects?

Yes, you can use cmdstanr and brms to configure and run multilevel models with random effects. These dependencies allow you to specify priors for Bayesian regression and generate posterior distribution visualizations for structured effect estimation.

What is the best way to visualize causal DAGs and posterior distributions in R?

The best way to visualize causal DAGs and posterior distributions in R is using ggdag and bayesplot. These packages enable you to create and validate causal graphs, visualize model assumptions, and plot posterior distributions to inform model specification.

Do I need dagitty and ggdag to validate causal graphs before Bayesian regression?

You need dagitty and ggdag to validate causal graphs before Bayesian regression because they inform model specification and causal inference. Creating and visualizing these directed acyclic graphs ensures your structured effect estimation accurately reflects your causal assumptions.