Agent skill

r-bayes

Patterns for Bayesian inference in R using brms, including multilevel models, DAG validation, and marginal effects. Use when performing Bayesian analysis.

brycew6m4,252★ · +31/wk · 3 repos on radarProfile →
claude-codeNOASSERTION
Install
npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill r-bayes --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 10 KB
Bundled scripts: none
Path: skills/55-ab604-claude-code-r-skills/skills/r-bayes/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 3,244
Language: Stata
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

## Core Packages ```r library(brms) library(cmdstanr) library(dagitty) library(ggdag) library(marginaleffects) library(tidybayes) library(bayesplot) ``` ## Directed Acyclic Graphs (DAGs) Prior to causal inference, create and validate DAGs with dagitty and ggdag. ### Define DAG Structure ```r dag <- dagitty(' dag { # Node positions for visualization exposure [pos="0,1"] mediator [pos="1,1"] outcome [pos="2,1"] confounder [pos="1,0"] # Edges (arrows) confounder -> exposure confounder -> outcome exposure -> mediator mediator -> outcome exposure -> outcome } ') ``` ### Identify Adjustment Sets ```r # For direct effect adjustmentSets(dag, exposure = "treatment", outcome = "outcome", effect = "direct") # For total effect adjustmentSets(dag, exposure = "treatment", outcome = "outcome", effect = "total") ``` ### Validate DAG Against Data ```r # Get implied conditional independencies implied_cis <- impliedConditionalIndependencies(dag) # Test against data ci_results <- localTests(dag, data = analysis_data, type = "cis") # Assess validation ci_df <- as.data.frame(ci_results) ci_df$independent <- ci_df$p.value > 0.05 pct_supported <- 100 * mean(ci_df$independent, na.rm = TRUE) cat(sprintf("DA

What's inside
Steps it walks through
  1. Core Packages
  2. Directed Acyclic Graphs (DAGs)
  3. Define DAG Structure
  4. Identify Adjustment Sets
  5. Validate DAG Against Data
  6. Visualize DAG
  7. Bayesian Regression with brms
  8. Standard Configuration
  9. Priors
  10. Common Families
  11. Multilevel Models
  12. Random Intercepts
  13. Random Slopes
  14. Crossed Random Effects
More from Auto-Empirical-Research-Skills
All skills →
About this skill
What does the r-bayes skill do?

Patterns for Bayesian inference in R using brms, including multilevel models, DAG validation, and marginal effects. Use when performing Bayesian analysis.

How do I install it?

Run `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill r-bayes --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From brycewang-stanford/Auto-Empirical-Research-Skills, a repository with 3,244 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going