Summary
An estimate per group, the mean or median, with an interval around it: the numbers behind error bars.
Static preview; loading the interactive plot
<script>
import { Plot } from "hmplot";
import { Summary } from "hmplot/stats";
import { ErrorBars } from "hmplot/charts";
const data = { group: ["a", "a", "a", "b", "b", "b"], value: [1, 2, 3, 4, 6, 5] };
</script>
<Plot {data} height={300} axes2d>
<Summary field="value" by="group" interval="standard-error">
<ErrorBars x="group" y="estimate" lower="lower" upper="upper" />
</Summary>
</Plot>
Usage
Outputs estimate, lower, upper, count, standardDeviation, and standardError. Default estimate is mean and interval is none. Analytic intervals require mean; bootstrap supports mean or median with 1,000 replicates and seed 42 by default. A singleton has no defined sample variability.
To let the viewer change a setting, read an input in it: interval={input("interval")} (Python interval=hm.input.interval), where interval is a Select of interval names.