Hierarchical Bayesian model
Set up, run, and review this analysis in Lifescio.
Supported analysis
A Gaussian regression gives each group a varying intercept drawn from a shared distribution. The group-scale prior controls plausible between-group variation; posterior sampling estimates group effects and common coefficients with partial pooling.
Supported scope: The current model has Gaussian outcomes and varying intercepts, with standardized predictors. Random slopes, cross-classified groups and non-Gaussian hierarchical outcomes are not supported. Few groups can leave the group-scale posterior strongly prior-sensitive.
Prepare data and configure the analysis
Enter Outcome, numeric Group identifier, then one to eight varying numeric predictors. Use 2–100 groups. The group code is an identifier; the engine indexes groups rather than treating the numbers as a linear predictor.
This workflow fits a Gaussian model with varying intercepts and common predictor slopes. Predictors and the outcome are standardized. Coefficient prior SD controls population coefficients and intercept; Group SD prior scale controls a half-normal prior on between-group spread in standardized outcome units. Set tuning, retained draws, and multiple chains for sampling review.
Input reference (6 fields)
Enter your data and prespecified choices. Ranges include both limits. For table fields, use cell editing, Paste data, or Import CSV / TSV. Review whether the first imported row contains headings and map the source columns before applying the import. Empty numeric cells are not treated as zero. Open file is for an exported Lifescio analysis JSON file, not a spreadsheet.
| Input | Format | Allowed range | Guidance |
|---|---|---|---|
| Outcome, group and predictors | Table | — | Use at least 8 observations: outcome first, numeric group ID second, then 1–8 predictors. Use 2–100 groups. Outcome and predictors must vary. Columns in order: Outcome; Group; Predictor. |
| Coefficient prior SD (standardized predictors) | Number | 0.01–100 | — |
| Group SD prior scale | Number | 0.01–100 | — |
| Posterior draws per chain | Whole number | 200–3000 | — |
| Warm-up draws per chain | Whole number | 200–3000 | — |
| Chains | Whole number | 2–4 | — |
Run and review
- Give the analysis a descriptive name and review every example value. Record units, data preparation, and planning assumptions in Reproducibility & notes. For simulations, record the seed and replication or sampling settings.
- Choose Run analysis. Resolve input errors before interpreting output. In the connected app, a run uses a saved input revision; local preview runs need the page to stay open.
- Review Diagnostics for method limitations, warnings, and available numerical checks. A completed run means computation finished; it does not establish that the assumptions fit your study.
- Use the Result table selector to inspect each output. Editing inputs does not recalculate existing results: an earlier-input notice means you need to run again to obtain matching results.
Understand the outputs
Posterior summaries includes Group_SD and Group_offset parameters. An offset is a standardized latent value; the group's model-scale deviation is Group_SD multiplied by that offset. Do not report an offset alone as an outcome-unit group effect. Joint posterior dependence matters when quantifying uncertainty in such products.
Standardization gives scale conversions, and Predictive checks returns predictions for the supplied observations and their existing groups in outcome units. The output does not provide predictions for a new, unseen group or varying slopes.
Troubleshooting and common mistakes
Check for too few or too many distinct groups, constant predictors, and an outcome without variation. A group label accidentally entered as a predictor changes the model and can produce a meaningless numeric trend.
If group-scale or offset diagnostics are poor, inspect group sizes, prior scales, and model suitability before merely increasing draws. A narrow posterior from a strong prior should be assessed for sensitivity. Binary outcomes, nested additional levels, and varying slopes require another model.
After correcting inputs, run again and check that the results belong to the new input snapshot. Increasing simulation draws improves numerical precision only; it does not repair invalid data or an unsuitable model.
Save, compare, and export
In the connected app, Save analysis retains the inputs in your account. Run history lets you inspect earlier runs, each with the input revision it used. In local preview, Save analysis downloads an input file instead; download results before leaving the page.
Use Result + inputs for a JSON archive containing the completed result and its inputs, Download CSV for the selected result table, PDF report for a report, and a chart's SVG button for its figure. Table displays round to three decimals; CSV and JSON exports retain calculation precision. Use those values when assessing a result near a decision boundary.
To reopen an archive, select the matching analysis method and choose Open file. Imported inputs start a new draft; a result archive can also display its retained result. It does not attach itself to an existing account analysis or recompute the result. Save or run the imported draft when you want a new account record.