{
  "tool": "mph-health-economics--policy.two_by_two",
  "name": "Measures of association from a 2×2 table (CDU-HEA-MPH-900)",
  "answers": "In this cohort, how much more (or less) likely is the outcome among the exposed, and how many must be exposed for one extra (or one fewer) case?",
  "degree": {
    "id": "competency:mph-health-economics--policy",
    "code": "CDU-HEA-MPH-900",
    "name": "MPH Health Economics & Policy",
    "version": "1.0.0"
  },
  "reference": "Rothman, Greenland & Lash, Modern Epidemiology: risk ratio (log-scale 95% CI), risk difference, odds ratio; NNT = 1/|RD|",
  "endpoint": "/faculty/mph-health-economics--policy/two_by_two",
  "feeSt": 1,
  "inputSchema": {
    "type": "object",
    "required": [
      "pan",
      "exposedCases",
      "exposedNonCases",
      "unexposedCases",
      "unexposedNonCases"
    ],
    "properties": {
      "pan": {
        "type": "string",
        "description": "The student PAN — the degree must be held in one of its five slots",
        "pattern": "^[0-9 ]{16,19}$"
      },
      "exposedCases": {
        "type": "number",
        "description": "a: exposed with the outcome",
        "minimum": 0
      },
      "exposedNonCases": {
        "type": "number",
        "description": "b: exposed without it",
        "minimum": 0
      },
      "unexposedCases": {
        "type": "number",
        "description": "c: unexposed with the outcome",
        "minimum": 0
      },
      "unexposedNonCases": {
        "type": "number",
        "description": "d: unexposed without it",
        "minimum": 0
      }
    },
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "riskExposed",
      "riskUnexposed",
      "riskRatio",
      "riskRatioLower95",
      "riskRatioUpper95",
      "riskDifference",
      "oddsRatio",
      "numberNeeded"
    ],
    "properties": {
      "riskExposed": {
        "type": "number",
        "description": "a ÷ (a + b)"
      },
      "riskUnexposed": {
        "type": "number",
        "description": "c ÷ (c + d)"
      },
      "riskRatio": {
        "type": "number",
        "description": "RR"
      },
      "riskRatioLower95": {
        "type": "number",
        "description": "Lower 95% bound of RR"
      },
      "riskRatioUpper95": {
        "type": "number",
        "description": "Upper 95% bound of RR"
      },
      "riskDifference": {
        "type": "number",
        "description": "Risk exposed − risk unexposed"
      },
      "oddsRatio": {
        "type": "number",
        "description": "(a·d) ÷ (b·c)"
      },
      "numberNeeded": {
        "type": "number",
        "description": "1 ÷ |RD| (to harm if RD > 0, to treat if RD < 0)"
      }
    },
    "additionalProperties": false
  },
  "example": {
    "exposedCases": 30,
    "exposedNonCases": 70,
    "unexposedCases": 15,
    "unexposedNonCases": 85
  }
}