Created
October 20, 2025 19:47
-
-
Save mcnuttandrew/fc5cde3cbecea19a708e0d1c64fadbde to your computer and use it in GitHub Desktop.
bland-altman sketch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://vega.github.io/schema/vega-lite/v6.json", | |
| "data": {"url": "data/anscombe.json"}, | |
| "transform": [ | |
| {"calculate": "datum.X - datum.Y", "as": "diff"}, | |
| {"calculate": "(datum.X + datum.Y) / 2", "as": "avg"} | |
| ], | |
| "layer": [ | |
| { | |
| "mark": "point", | |
| "encoding": { | |
| "x": {"field": "avg", "type": "quantitative"}, | |
| "y": {"field": "diff", "type": "quantitative"} | |
| } | |
| }, | |
| { | |
| "mark": "rule", | |
| "encoding": {"y": {"aggregate": "average", "field": "diff"}} | |
| }, | |
| { | |
| "mark": "rule", | |
| "transform": [ | |
| { | |
| "aggregate": [ | |
| {"op": "mean", "field": "diff", "as": "mean_X"}, | |
| {"op": "stdev", "field": "diff", "as": "std_X"} | |
| ] | |
| }, | |
| {"calculate": "datum.mean_X + 1.96 * datum.std_X", "as": "std_calv"} | |
| ], | |
| "encoding": {"y": {"field": "std_calv", "type": "quantitative"}} | |
| }, | |
| { | |
| "mark": "rule", | |
| "transform": [ | |
| { | |
| "aggregate": [ | |
| {"op": "mean", "field": "diff", "as": "mean_X"}, | |
| {"op": "stdev", "field": "diff", "as": "std_X"} | |
| ] | |
| }, | |
| {"calculate": "datum.mean_X - 1.96 * datum.std_X", "as": "std_calv"} | |
| ], | |
| "encoding": {"y": {"field": "std_calv", "type": "quantitative"}} | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment