to construct exogenous benchmark/reference prices to which we will compare the unit prices of the items included the import declarations in the Madagascar customs data (as will be described below).

- **Delegated randomization of inspector assignment and IT manipulation** On November 18, 2017 the assignment of inspectors to declarations was delegated to GasyNet. By comparing daily their list of declarations (that their system randomly assigned to some inspector) to the list of declarations that cleared customs from the customs administration, GasyNet was able to identify declarations that were withheld from the delegated randomization - as will be discussed in Section 9. They provided us with the list of withheld declarations.

- **Human resources data** Information on inspectors’ gender, education, age, and date of entry into work for the customs administration were provided by the Human Resources Department ( _Direction des ressources et de la formation_ ).

- **Inspectors’ survey** In 2017 we conducted a nationwide survey of inspectors which contained questions on job and pay satisfaction, corruption, ethics, fairness, and interactions with brokers and importers.

Madagascar’s raw customs data covers all formal import transactions made under several regimes: final imports for consumption (imports for home use), re-imports, temporary admissions, inward processing, warehouse, and other. Our analysis focuses on import declarations subject to taxation and to a physical or a documentary control by customs inspectors in Toamasina.<sup>15</sup> This implies focusing only on imports for home use and re-imports and excluding declarations from importers that are members of the “ _Procédure Accélérée de Dédouanement_ ” (PAD), a trusted trader program that allows member firms to benefit from expedited clearance procedures with minimal controls at the border. To minimize the risk of identifying as likely to be suspect of corruption declarations that are not, we remove from the sample (i) declarations registered by brokers that do not interact frequently with customs (i.e., brokers that register less than 50 declarations per semester); (ii) declarations assigned to inspectors that relocate to or move away from Toamasina during a given semester but are active for less than two consecutive months in that semester.<sup>16</sup> Our final sample accounts for an average of 76.9 percent of declarations, 78.9 percent of collected taxes, and 76.5 percent of total import value for import declarations subject to taxation and to a physical or a documentary control cleared in Toamasina across the period ranging from January 1 2015 to November 17 2018.<sup>17</sup> To analyze which declarations are most likely to be subject to corruption agreements we will use measures of excess interaction between inspectors and brokers as proxies for IT manipulation described in Sections

> 15Imports subject to specific clearance procedures (oil and vehicles) are excluded.

> 16Our sample also excludes observations in the top and bottom 2.5% of the yearly distribution of initial average internal reference price, defined as the weighted average of internal reference prices for all items included in the import declaration with weights being the initially submitted weights. The internal reference price for each item is the median unit price (ratio of value to weight) reported across Malagasy importers for a given HS 8-digit-origin country-year.

> 17Our sample ends one year after the start of the delegated randomization of inspector assignment to the third party and a few days before the unveiling of the IT manipulation taking place during this delegated randomization.

9