Follow ______ on twitter.

8.4.3 Evaluating uncertainties and assumptions in the modeling results

Code

Vega-Lite Chart

{
  "hconcat": [
    {
      "title": "Warehouse Fraud Risk Factors",
      "height": 150,
      "width": 250,
      "data": {
        "values": [
          {
            "factor": "Weak Audit",
            "increase": 80,
            "decrease": 20
          },
          {
            "factor": "Poor Training",
            "increase": 70,
            "decrease": 20
          },
          {
            "factor": "Lack of Controls",
            "increase": 90,
            "decrease": 20
          },
          {
            "factor": "Ineffective Supervision",
            "increase": 75,
            "decrease": 20
          }
        ]
      },
      "transform": [
        {
          "calculate": "max(datum.increase, datum.decrease)",
          "as": "impact"
        }
      ],
      "layer": [
        {
          "mark": "bar",
          "encoding": {
            "x": {
              "field": "increase",
              "type": "quantitative",
              "scale": {
                "domain": [
                  0,
                  100
                ]
              },
              "axis": {
                "title": "Potential Fraud Losses (in $K)"
              }
            },
            "y": {
              "field": "factor",
              "type": "ordinal",
              "sort": {
                "field": "impact",
                "order": "descending"
              },
              "axis": {
                "title": null
              }
            },
            "color": {
              "value": "#00a65a"
            }
          }
        },
        {
          "mark": "bar",
          "encoding": {
            "x": {
              "field": "decrease",
              "type": "quantitative",
              "scale": {
                "domain": [
                  0,
                  100
                ]
              },
              "axis": {
                "title": "Potential Fraud Losses (in $K)"
              }
            },
            "y": {
              "field": "factor",
              "type": "ordinal",
              "sort": {
                "field": "impact",
                "order": "descending"
              }
            },
            "color": {
              "value": "#ffffff"
            }
          }
        },
        {
          "mark": "rule",
          "encoding": {
            "x": {
              "value": 0
            },
            "size": {
              "value": 0
            },
            "color": {
              "value": "#000"
            }
          }
        }
      ]
    },
    {
      "title": "Education Stock Performance Risk Factors",
      "height": 150,
      "width": 250,
      "data": {
        "values": [
          {
            "factor": "New Regulation",
            "increase": 15,
            "decrease": -10
          },
          {
            "factor": "Market Sentiment",
            "increase": 12,
            "decrease": -12
          },
          {
            "factor": "Demand for Online",
            "increase": 7,
            "decrease": -5
          },
          {
            "factor": "Competition",
            "increase": 8,
            "decrease": -7
          }
        ]
      },
      "transform": [
        {
          "calculate": "max(abs(datum.increase), abs(datum.decrease))",
          "as": "impact"
        }
      ],
      "layer": [
        {
          "mark": "bar",
          "encoding": {
            "x": {
              "field": "increase",
              "type": "quantitative",
              "scale": {
                "domain": [
                  -20,
                  20
                ]
              },
              "axis": {
                "title": "% Return over the Year"
              }
            },
            "y": {
              "field": "factor",
              "type": "ordinal",
              "sort": {
                "field": "impact",
                "order": "descending"
              },
              "axis": {
                "title": null
              }
            },
            "color": {
              "value": "#00a65a"
            }
          }
        },
        {
          "mark": "bar",
          "encoding": {
            "x": {
              "field": "decrease",
              "type": "quantitative",
              "scale": {
                "domain": [
                  -20,
                  20
                ]
              },
              "axis": {
                "title": "% Return over the Year"
              }
            },
            "y": {
              "field": "factor",
              "type": "ordinal",
              "sort": {
                "field": "impact",
                "order": "descending"
              }
            },
            "color": {
              "value": "#f56954"
            }
          }
        },
        {
          "mark": "rule",
          "encoding": {
            "x": {
              "value": 0
            },
            "size": {
              "value": 0
            },
            "color": {
              "value": "#000"
            }
          }
        }
      ]
    }
  ]
}