{
  "tool": "mpa-public-administration.gini",
  "name": "Gini coefficient (CDU-BUS-MPA-900)",
  "answers": "How unequal is this income distribution, on the scale from 0 (equal) to 1?",
  "degree": {
    "id": "competency:mpa-public-administration",
    "code": "CDU-BUS-MPA-900",
    "name": "MPA Public Administration",
    "version": "1.0.0"
  },
  "reference": "Gini (1912); the mean-absolute-difference definition used by the World Bank Poverty and Inequality Platform",
  "endpoint": "/faculty/mpa-public-administration/gini",
  "feeSt": 1,
  "inputSchema": {
    "type": "object",
    "required": [
      "pan",
      "incomes"
    ],
    "properties": {
      "pan": {
        "type": "string",
        "description": "The student PAN — the degree must be held in one of its five slots",
        "pattern": "^[0-9 ]{16,19}$"
      },
      "incomes": {
        "type": "array",
        "description": "Income of each person or household (not negative)",
        "items": {
          "type": "number"
        }
      }
    },
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "gini",
      "mean"
    ],
    "properties": {
      "gini": {
        "type": "number",
        "description": "Σ|xi − xj| ÷ (2n²μ)"
      },
      "mean": {
        "type": "number",
        "description": "Mean income"
      }
    },
    "additionalProperties": false
  },
  "example": {
    "incomes": [
      12000,
      18000,
      25000,
      31000,
      40000,
      52000,
      68000,
      90000,
      130000,
      250000
    ]
  }
}