Skip to main content

outliers: values beyond 1.5 IQR flagged

AFC, 2024
TeamPFPA
385326
402301
425311
309434
525†368
345364
338404
289417
Marked values fall outside 1.5 × IQR of the column quartiles.
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

// Buffalo's 525 points for sits above the upper fence; nothing in points against does.
const spec = defineTable<Standing>()
.columns((c) => [
c.logo("team", { league: "nfl" }),
c.int("pf", { label: "PF" }),
c.int("pa", { label: "PA" }),
])
.outliers(["pf", "pa"], { symbol: "†", note: true })
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: decoration · outliers · gt_outliers. All sdvtables examples.