hierarchical-models

Provide structured patterns for hierarchical Bayesian modeling in Stan and JAGS.

9|1|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/choxos/BiostatAgent --skill hierarchical-models
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hierarchical-models
Source: https://github.com/choxos/BiostatAgent/tree/main/plugins/bayesian-modeling/skills/hierarchical-models
Command: npx skills add https://github.com/choxos/BiostatAgent --skill hierarchical-models

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Patterns and workflows for hierarchical/multilevel Bayesian modeling, including random effects, partial pooling, and centered vs non-centered parameterizations.

Core Features & Use Cases

  • Structured parameterizations for centered and non-centered approaches in Stan and JAGS.
  • Guidance for modeling nested/grouped data and meta-analytic contexts with study-level variation.
  • Diagnostics considerations and classic examples (e.g., the Eight Schools).

Quick Start

Run an eight-schools example in Stan to observe centering effects on group estimates.

Frequently Asked Questions about hierarchical-models

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

FAQPage Schema
How do I build hierarchical Bayesian models with partial pooling in Stan?

Hierarchical Bayesian models in Stan use structured parameterizations for random effects and partial pooling to estimate group-level variation. This Skill provides patterns for both centered and non-centered approaches to handle nested data effectively.

When should I use centered vs non-centered parameterization in multilevel models?

Use non-centered parameterization in multilevel models when sampling divergences occur, particularly with hierarchical data where group-level variance estimates are challenging. Centered parameterization works well when data is informative enough to constrain group estimates effectively.

Can I use JAGS instead of Stan for hierarchical Bayesian modeling?

Yes, JAGS supports hierarchical Bayesian modeling with random effects and partial pooling. This Skill provides structured parameterization patterns for both JAGS and Stan implementations, allowing you to apply multilevel modeling workflows in either framework.

What diagnostics should I check for hierarchical Bayesian models with random effects?

Diagnostics for hierarchical Bayesian models with random effects focus on identifying sampling divergences, checking convergence of group-level variance parameters, and comparing centered versus non-centered parameterization outputs to ensure stable estimates across nested data structures.

How do I model study-level variation for meta-analysis using Bayesian methods?

Model study-level variation in meta-analysis using hierarchical Bayesian structures that apply partial pooling across studies. This approach treats each study as a group with its own effect estimate, borrowing strength across studies to stabilize overall estimates.

Why does my hierarchical model in Stan have divergent transitions with nested data?

Divergent transitions in hierarchical models with nested data often stem from constrained parameter spaces in centered parameterizations. Switching to a non-centered parameterization reparameterizes the random effects hierarchy to improve sampler geometry and resolve divergences.