Follow ______ on twitter.

1.4.3 Assumptions in Models

Code

Vega-Lite Chart

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "hconcat": [
    {
      "title": "Constant Relationships",
      "data": {
        "sequence": {
          "start": 0,
          "stop": 11,
          "step": 1,
          "as": "x"
        }
      },
      "transform": [
        {
          "calculate": "5",
          "as": "y"
        }
      ],
      "mark": "point",
      "encoding": {
        "x": {
          "field": "x",
          "type": "quantitative",
          "title": "X"
        },
        "y": {
          "field": "y",
          "type": "quantitative",
          "title": "Y (Constant)",
          "scale": {
            "domain": [
              0,
              10
            ]
          }
        }
      }
    },
    {
      "title": "Linear Relationships",
      "data": {
        "sequence": {
          "start": 1,
          "stop": 11,
          "step": 1,
          "as": "x"
        }
      },
      "transform": [
        {
          "calculate": "datum.x",
          "as": "y"
        }
      ],
      "mark": {
        "type": "line",
        "point": true
      },
      "encoding": {
        "x": {
          "field": "x",
          "type": "quantitative",
          "title": "X"
        },
        "y": {
          "field": "y",
          "type": "quantitative",
          "title": "Y (Linear)"
        }
      }
    },
    {
      "title": "Normal Data Distribution",
      "data": {
        "sequence": {
          "start": 1,
          "stop": 1001,
          "step": 1,
          "as": "i"
        }
      },
      "transform": [
        {
          "calculate": "sampleNormal(10, 3)",
          "as": "y"
        }
      ],
      "mark": "bar",
      "encoding": {
        "x": {
          "bin": {
            "maxbins": 20
          },
          "field": "y",
          "type": "quantitative",
          "title": "Value"
        },
        "y": {
          "aggregate": "count",
          "title": "Count"
        }
      }
    }
  ],
  "config": {
    "axis": {
      "labelFontSize": 12,
      "titleFontSize": 14
    },
    "title": {
      "fontSize": 16
    }
  }
}