## tnmea2023005

## Source details

**Canonical URL:** [tnmea2023005](https://www.imf.org/-/media/files/publications/tnm/2023/english/tnmea2023005.pdf)

## Other formats

- [Markdown version](/-/media/files/publications/tnm/2023/english/tnmea2023005.pdf.md)
- [Structured JSON version](/-/media/files/publications/tnm/2023/english/tnmea2023005.pdf.json)

---

### Introduction: definition, purpose, and operational role
- Mirror data analysis: comparing, for the same product and period, the flows reported by the exporting country with those reported by the country receiving the goods and identifying discrepancies.
- Primary operational aim for customs administrations: risk management for control to target transactions presenting the highest risks and improve collection of duties and taxes.
- Typical irregularities detectable:
  - Underdeclaration of the value of the imported goods (the taxable base).
  - Incorrect tariff classification (use of a subheading with a low rate of duty or tax that is not applicable).
  - Declaring an incorrect country of origin under preferential rules of origin.
  - Misuse of special procedures that suspend duties and taxes, with later illegal diversion to domestic market.
  - Export reported by country of departure but not found in customs data of country of arrival (possible import smuggling).
- Key statistics and performance observations:
  - On average, in low-income countries, 83 percent of imports are currently selected for documentary or physical customs verification of goods, compared with 42 percent in emerging markets and 12 percent in advanced economies.
  - In Gabon, over the three-year period 2013, 2014, and 2015, only 1.13 percent of the declarations that were checked during the customs clearance process, which accounted for 90 percent of all declarations received, were deemed incorrect.
- Reported results from IMF-supported implementations:
  - One customs administration reports mirror analysis significantly contributed to a doubling of the compromised duties and taxes detected by the postclearance audit function between 2020 and 2022.
  - Another reports that already 15 percent of the compromised duties and taxes recovered after clearance of goods came from audits initiated because of a discrepancy identified by the mirror analysis.
  - A third reported detection of significant misrepresentations or missing import declarations for consumer goods such as meat, wheat, and cement.

### The application of mirror analysis as a catalyst for data-analysis function
- Specific value and empirical background:
  - Mirror analysis cross-references a country’s import data with external sources presented in a similar, directly exploitable format; recognized as "particularly welcome and effective" (World Customs Organization 2015).
  - Historical examples and studies cited (first use 1964 by Bhagwati; subsequent studies include Fisman and Wei 2004; Mishra, Subramanian, and Topalova 2008; Worku, Mendoza, and Wielhouwer 2016; Van Dunem and Arndt 2009; Levin and Widell 2014; Rijkers, Baghdadi, and Raballand 2015).
  - Practical implementations cited: Cameroon, Malawi, Madagascar; exercises underway in Benin, Comoros, Côte d’Ivoire.
- Operational extension and core concepts:
  - Uses most disaggregated import data available (HS6 recommended) and focuses on differences in customs value, quantity, tariff classification (HS codes), country of origin, and declared elements (e.g., misuse of procedures).
  - Notation and interpretation: "M–X" discrepancies (M = imports; X = exports); e.g., M<X (negative gap) often signals undervaluation to reduce duties.
- Typical fraud mechanisms revealed by mirror gaps:
  - Negative gaps (M<X): undervaluation, tariff slippage, smuggling, lost exports.
  - Positive gaps (M>X): overvaluation (transfer pricing, capital flight), tariff slippage toward low-duty headings.
  - Other misdeclarations: incorrect origin claims to secure preferential rates.
- Challenges and precautions (selected causes of nonfraud discrepancies):
  - Differences in tariff classification, imperfect currency conversions, transit time recording differences, distinct notions of country of origin vs country of provenance, weak export declaration control, different reporting thresholds, domestic regimes (free zones).
  - Eurostat asymmetry categories: (1) causes existing despite harmonized methodology; (2) causes due to methodological differences; (3) causes from collection system malfunctions.
- Analytical implication:
  - Identification of probable cause is necessary before treating a gap as fraud; mirror analysis identifies inconsistencies that should prompt customs action, not prove fraud.
  - Aggregated gaps may contain offsetting positive and negative discrepancies; reliable reconstruction of potential revenue shortfalls requires disaggregated risk analysis and results from customs verifications.

### Methodology: databases, extraction, merging, and gap calculations
- Databases and tools:
  - Internal data: importing country’s customs information system (examples: ASYCUDA, GAINDE).
  - External data: Comtrade (UNCTAD) via WITS (World Integrated Trade Solution); Comtrade provides FOB values in thousands of US dollars at HS6.
- Import data extraction and required fields (must include):
  1. country of provenance;
  2. import date;
  3. national HS and subdivision code up to the most detailed level used by the country (for example, HS10);
  4. the customs procedure with an additional code;
  5. the FOB invoice amount in local currency;
  6. net weight, quantity, and additional units;
  7. total duties and taxes paid for goods that are consumed directly and indirectly;
  8. the cumulative taxation rate.
- Export data preparation (WITS/Comtrade):
  - Keep HS6 with description, exporter name and code (three-digit ISO), value of gross export, and weight.
  - Convert gross export value into local currency using the average exchange rate for the year (exchange rate source: central bank).
  - If customs uses two-digit exporter codes, convert three-digit codes accordingly.
- Merge and finalization steps (procedural checklist condensed):
  - Export-file preparation: steps 1–7 (open WITS data; keep necessary columns; rename variables; convert gross exports to local currency; adjust exporter codes; sort and save).
  - Import-file preparation: steps 8–15 (open customs data; replace missing last country of consignment with country of origin; delete partners not reporting to UN Comtrade; select validated regime codes; keep necessary columns; create HS6 and aggregate; rename variables; sort).
  - Merge databases: steps 16–19 (combine on HS6 and ExporterCode; fill missing HS6 product descriptions and Exporter Name; create HS4 and HS2; save final merged database).
- Calculate gaps (step 20):
  - Absolute gaps: M–X for values and weights.
  - Relative gaps: M/X for values and weights.
  - Expected standard file format: includes columns for HS position; Import Value declared in importing country (local currency unit); Export Value declared by partner countries (local currency unit); M–X Discrepancy on Values (local currency unit); M/X in Value; Import Declared Weight (kg); Export Weight declared by partner countries (kg); M–X Discrepancy on Weight (kg); M/X in Weight; and the ratio (1)/(2).
  - Note: Some ratios M/X cannot be computed when X = 0; values may be blank in that case.

### Interpretation, triage, and selection methodology
- Types of situations when confronting import data with partner exports:
  - Matching flows: partner country’s export is reported for the declared import description.
  - Orphan imports: trade flow declared by importing country’s customs but missing in partner country.
  - Lost exports: partner country reports exports that have no corresponding import declaration in the importing country.
- Importance of disaggregated data:
  - Use the most detailed disaggregation available (preferably HS6).
  - Start analysis at HS2 only to screen, but always drop down to HS6 to reveal potential customs fraud.
  - Aggregation concealment: neutral discrepancy at HS2 may conceal opposite situations at HS4/HS6.
  - Empirical matching rates at HS6: matching lines are 65 percent (by tariff heading) and 36 percent (by partner-tariff-heading pairs); orphan imports among non-matching lines account for 11 percent and 34 percent of total imports in value, respectively.
- Recommended method for selecting tariff headings/subheadings for investigation:
  - Prioritize by value discrepancies (M–X), orphan imports and lost exports, weight discrepancies (bulk goods), chapter’s share in total revenue/import volume, effective taxation rate (high effective rate may be associated with negative M<X), and discrepancy between effective and legal rates.
  - Stepwise disaggregation: chapter → HS4 → HS6 to pinpoint problematic subheadings and potential tariff slippages.
- Interpretation grid for chapter-level M–X:
  - M–X = 0: no irregularity or offsetting irregularities at subposition level.
  - M–X < 0: lowering of value/quantity, tariff slippage, irregularity on origin, smuggling, or lost exports.
  - M–X > 0: transfer pricing/capital flight, tariff slippage toward lower-tariff positions, or orphan imports aggregated with matching flows.

### Operational follow-up, verification, and preventive measures
- Sorting and triage objectives:
  - Assess likelihood of fraud and effect on revenue and regulatory compliance.
  - Link discrepancies to other risk criteria (repeat offenders, inconsistent origin).
  - Detect small but persistent discrepancies indicating systemic irregularities.
- Examination and enforcement actions:
  - Postclearance audit investigates customs value, rules of origin, and HS classification; customs have right of access to require documents from importers and third parties.
  - Mirror discrepancies justify administrative requests to exporting-country customs for documents.
  - Investigation service mobilized when dossiers suggest smuggling or undeclared imports/exports.
  - Where no infringement is found after verification, verified importers should be placed in the low-risk segment for facilitation.
- Preventive measures and dynamic selection:
  - Incorporate selection criteria targeting new declarations with similar suspicious characteristics.
  - Use physical inspections and weighing before clearance when false quantity declarations are suspected.
  - Dynamic risk analysis should target: 1. new transactions; 2. a randomly selected percentage of declarations; 3. declarations selected by probability of fraud; 4. alerts manually added by customs (mirror discrepancies fall into category 4).
  - Caution: avoid clogging selectivity systems with broad or insufficiently founded criteria.
- Other uses of mirror-analysis results:
  - Rule or procedure changes (exemptions, suspension regimes, oversight of customs agents).
  - Estimation of missing customs revenues and strategic risk analysis using sorted and verified results.
  - Amendment and harmonization of customs/statistical practices to aid trade facilitation and reliable statistics.
  - Evaluation of customs performance and capacity building.
  - Foster routine exchange of import/export flow data among customs administrations (especially within customs unions).

### Institutional setup, automation, and longer-term reforms
- Suggested institutional framework:
  - Establish a permanent "Mirror Data Analysis Unit".
    - Recommended size: "five or six officers".
    - Composition: staff with data-analysis skills supported by intelligence analysts and investigators.
    - Integration: part of a broader customs data-analysis structure; upstream links to intelligence/investigations/postclearance; downstream links to postclearance control and risk management team.
  - In low-capacity administrations: position the Mirror Data Analysis Unit within data analysis; building data-analysis capacity is generally easier than building intelligence functions.
- Automation and IT integration (four technical steps):
  1. automatic loading of Comtrade data,
  2. extraction of data from the transactional database of the customs system,
  3. comparison of the two databases,
  4. gap analysis and production of mirror analysis results.
- Potential catalytic role:
  - Mirror Data Analysis Unit can lead to a Statistical Monitoring and Data Processing division.
  - Recommended to set up a high-level committee to oversee development of mirror-analysis and statistical/data-processing projects.
  - Additional tasks for a statistical monitoring and data-processing division include automated cross-checking with tax authorities, modernization of risk management systems, monitoring compliance (undischarged operations and arrears), and improving foreign trade statistics (issues from free zones and processing under supervision).

### Practical guidance and concise recommendations (Box 1 condensed)
- Implement mirror analysis; it enables cross-checking of all import data with an external source in a directly usable format.
- Use the finest level of detail possible (HS6 recommended); absence of discrepancy at chapter level does not guarantee absence at HS4 or HS6.
- Cross-checking with external data is high-impact for limited investment.
- Prepare data carefully (convert internal to FOB, external to current local currency) before creating a unified working file.
- Analyze corresponding flows and “lost exports” and “orphan imports.”
- Treat discrepancies as potential indicators, not proof, of fraud; follow with careful examination and formal customs checks.
- Use results, once sorted and verified, to help reconstruct revenue gaps between collected and potential revenue.

### Annex 1: Seven steps for extracting mirror data in WITS (procedural summary)
- Step 1: Connect to the WITS login page.
- Step 2: Register to obtain a login.
- Step 3: Use “ADVANCED QUERY” and select “Trade Data (UN Comtrade).”
- Step 4: Create a “New Query” with a Query Name and Quick Description.
- Step 5: Define query parameters:
  - “Reporters”: countries that reported exports in UN Comtrade (select all relevant reporters).
  - “Products”: select HS nomenclature (e.g., HS 2017), Level of data disaggregation = Sub-Heading (HS6), and Clusters = All3 Sub-Heading.
  - “Partners”: importing country (country being studied) and benchmark year.
  - “Trade Flow”: select “Gross Export,” “Export,” and “Re-Export” (use “Gross Export” = “Export” + “Re-Export”).
- Step 6: Submit the query and check status.
- Step 7: When status is “Completed,” download the data.
- Recommended file formats and handling:
  - For large files, Stata is the most suitable format; Microsoft Access is an alternative; Microsoft Excel possible but limited to 1,048,576 rows.
  - Initially extract all available data to avoid returning to WITS.
  - In extraction settings, choose “Trade Flow Name” for “Pivot Header” and “Trade Value” for “Pivot Data”; arrange “Selected Columns” for an easy-to-handle columnar file.

*The Use of Mirror Data by Customs Administrations: From Principles to Practice, TNM/2023/05*

### Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

### Introduction

### Definition and Purpose of Mirror Data Analysis
- Mirror data analysis consists of comparing, for the same product and period, the flows reported by the exporting country with those reported by the country receiving the goods and identifying discrepancies.
- Primary operational aim for customs administrations: risk management for control to target transactions presenting the highest risks and improve collection of duties and taxes.

### Typical Irregularities Detectable
- Underdeclaration of the value of the imported goods (the taxable base).
- Incorrect tariff classification (use of a subheading with a low rate of duty or tax that is not applicable).
- Declaring an incorrect country of origin under preferential rules of origin (entitling goods to reduced or zero duty).
- Misuse of special procedures that suspend duties and taxes, with later illegal diversion to domestic market.
- Export reported by country of departure but not found in customs data of country of arrival (possible import smuggling).

### Operational Importance for Customs, Especially in Developing Countries
- Mirror analysis is particularly relevant where risk analysis and control selection lag behind best practices.
- For customs in developing countries, selective targeting is critical to avoid spreading resources thin and increasing opportunities for collusion and discretionary decisions.
- External data cross-checking complements internal risk analyses and can reveal fraud and movements that in-house data may not detect.

### Capacity Development and Reported Results
- IMF Fiscal Affairs Department supported mirror data use in Benin, Comoros, Côte d’Ivoire, Guinea, Kenya, Liberia, Senegal, Togo, and Zimbabwe.
- Reported outcomes from early implementations:
  - One customs administration reports mirror analysis significantly contributed to a doubling of the compromised duties and taxes detected by the postclearance audit function between 2020 and 2022.
  - Another reports that already 15 percent of the compromised duties and taxes recovered after clearance of goods came from audits initiated because of a discrepancy identified by the mirror analysis.
  - A third reported detection of significant misrepresentations or missing import declarations for consumer goods such as meat, wheat, and cement.

### Data Analysis Context and Complementarity with Other Sources
- Data analysis improves fraud control by reducing the importer's information advantage and mitigating information asymmetry.
- Customs administrations increasingly exploit in-house computerized data but internal techniques alone may be limited in increasing results.
- External sources for cross-checking include domestic tax administration data, port authority, banks, and other third-party data.
- Mirror data analysis is one technique within a broader risk-management system that should rely on third-party data, cross-checking, and exchange of information.

### Key Statistics and Performance Observations
- On average, in low-income countries, 83 percent of imports are currently selected for documentary or physical customs verification of goods, compared with 42 percent in emerging markets and 12 percent in advanced economies.
- In Gabon, over the three-year period 2013, 2014, and 2015, only 1.13 percent of the declarations that were checked during the customs clearance process, which accounted for 90 percent of all declarations received, were deemed incorrect.

### Challenges, Precautions, and Diagnostic Limits
- A discrepancy does not necessarily indicate fraud or irregularity in the country of importation; many potential causes exist.
- Steps necessary prior to creating a single file for analysis: express internal data in free-on-board value and convert external data into current local currency to ensure accuracy.
- Rigorous analysis must include the study of “lost exports” and “orphan imports.”
- Accurate estimates of missing revenue because of fraud or customs malfunctions cannot be derived directly from mirror analysis; however, sorted and verified results can help reconstruct gaps between revenue collected and potential revenue.
- It is after careful examination of each difference and identification of probable cause (risk analysis phase) that a suspicion of fraud can be concluded; certainty of fraud requires a formal and positive customs check.

### Practical Guidance Emphasized
- Mirror analysis must be carried out at the finest possible level of detail; a discrepancy at HS chapter level may hide differing situations at HS4 or HS6.
- Cross-checking with external data can reveal fraud and irregularities that internal data alone may miss and generally has a high effect for limited investment.
- Mirror analysis should be integrated into operational customs activities (risk targeting, postclearance audits, verification of special procedures) rather than treated as a purely statistical exercise.

- Box 1: Main Findings and Recommendations (condensed):
  - Implement mirror analysis; it enables cross-checking of all import data with an external source in a directly usable format.
  - Use the finest level of detail possible (HS6 recommended); absence of discrepancy at chapter level does not guarantee absence at HS4 or HS6.
  - Cross-checking with external data is high-impact for limited investment.
  - Prepare data carefully (convert internal to FOB, external to current local currency) before creating a unified working file.
  - Analyze corresponding flows and “lost exports” and “orphan imports.”
  - Treat discrepancies as potential indicators, not proof, of fraud; follow with careful examination and formal customs checks.
  - Use results, once sorted and verified, to help reconstruct revenue gaps between collected and potential revenue.

*The Use of Mirror Data by Customs Administrations — Introduction*

### 9. The application of mirror analysis can be a catalyst for the development of the data analysis function

### 9. The application of mirror analysis can be a catalyst for the development of the data analysis function

### The specific value of mirror analysis
- Mirror analysis cross-references a country’s import data with external sources presented in a similar, directly exploitable format; it is recognized as "particularly welcome and effective" (World Customs Organization 2015).
- Historical and empirical background:
  - First used in 1964 by Bhagwati to estimate customs fraud in Turkey.
  - Subsequent studies estimating relations between mirror discrepancies and taxation/fraud include: Fisman and Wei 2004 (China–Hong Kong SAR), Mishra, Subramanian, and Topalova 2008 (India), Worku, Mendoza, and Wielhouwer 2016 (Africa), Van Dunem and Arndt 2009 (Mozambique), Levin and Widell 2014 (Kenya and Tanzania), Rijkers, Baghdadi, and Raballand 2015 (Tunisia).
- Practical use by customs administrations:
  - Applied to estimate customs fraud in Cameroon (World Customs Organization 2015) and Malawi (Kalizinje 2018).
  - Used by Malagasy customs with World Bank support (Chalendard, Raballand, and Rakotoarisoa 2016).
  - Exercises underway in Benin, Comoros, and Côte d’Ivoire.
- Core concept:
  - Mirror analysis assesses differences in declared trade value for the same flow of goods (export declaration in partner country vs import declaration in importing country).
  - In a perfect framework (without transport and insurance cost), export value = import value; differences are attributed to misdeclaration by exporter, importer, or both.
  - Common operational assumption: exporter has little incentive to misdeclare exports, so discrepancies are generally attributed to importer noncompliance.
- Operational extension beyond aggregated value gaps:
  - Uses the most disaggregated import data available in the customs computerized system (see Section II).
  - Focuses on differences in: customs value, quantity, tariff classification (HS codes), country of origin, and other declared elements (e.g., misuse of customs procedures to suspend duties and taxes).
- Pricing/data conventions:
  - International databases commonly provide CIF for imports and FOB for exports; customs systems can often make FOB-FOB comparisons, essential for gap analysis.
  - Notation: "M–X" discrepancies (M = imports; X = exports); e.g., M<X (negative gap) often signals undervaluation to reduce duties.

### Typical fraud mechanisms revealed by mirror gaps
- Negative gaps (M<X) often indicate:
  - Undervaluation to reduce duties and taxes.
  - Tariff slippage: declaring a highly taxed good under a lower-duty tariff heading.
  - Smuggling or imports without declarations (tariff headings present on export side but absent on import side).
- Positive gaps (M>X) may indicate:
  - Overvaluation (e.g., transfer pricing, capital flight).
  - Tariff slippage producing positive gaps for goods with low duty rates used as a "safe haven."
- Other misdeclarations include incorrect origin claims to secure preferential rates.

### Challenges and precautions
- Many structural and logistical factors produce discrepancies unrelated to fraud; common causes include:
  - Differences in tariff classification between exporting and importing countries (Nitsch 2012) and misclassifications (Jean and Mitaritonna 2010).
  - Imperfect conversion of local currency imports into US dollars (Carrère and Grigoriou 2015).
  - Transit time of goods causing exports and imports to be recorded in different periods (Yeats 1995).
  - Distinct notions of country of origin vs country of provenance and different reporting standards (triangular trade, trans-shipment, re-export) (Hummels and Lugovskiy 2006; Ferrantino, Liu, Wang 2012).
  - Weakness of export declaration control in exporting countries (Stoyanov 2012).
  - Different minimum reporting thresholds across countries.
  - Domestic legislation/practices (e.g., free zones outside customs control).
- Eurostat categorization of asymmetry causes:
  1. Causes existing despite harmonized methodology (e.g., different exchange rates, triangular trade).
  2. Causes due to methodological differences (special trade vs general trade).
  3. Causes from collection system malfunctions (confidentiality-based exclusions, classification interpretation differences, fraudulent transactions).
- Analytical implications:
  - Identification of probable cause is necessary before treating a gap as fraud.
  - Mirror analysis aims to identify inconsistencies that should prompt customs action, not to demonstratively prove fraud.
  - Care must be taken not to extrapolate revenue loss from aggregated mirror gaps or from discrepancies whose origins are not precisely examined.
  - Aggregated gaps may contain offsetting positive and negative discrepancies; reliable reconstruction of potential revenue shortfalls requires disaggregated risk analysis and results from initial customs verifications.

### Integration with customs risk analysis and operational value
- Mirror data become additional indicators in a risk analysis framework; any transaction-specific information helps estimate fraud probability and prioritize controls.
- Particularly valuable for developing-country customs administrations and fragile states where submitted documentation is often unreliable, incomplete, or subject to collusion.
- Mirror analysis is inexpensive and easy to implement, making it well adapted to the capacities of many administrations (Grigoriou and others 2019).
- Mirror analysis results are especially actionable for postclearance audit units, which review past-year transactions.

### Methodology — databases and data extraction
- Mirror analysis combines:
  - Internal data: importing country’s customs information system (computerized customs clearance system; examples: ASYCUDA, GAINDE).
  - External data: international trade databases, primarily Comtrade (UNCTAD), accessible via UN statistics office and WITS (World Integrated Trade Solution).
- Import data (internal):
  - Extracted from declarations entered in the computerized customs clearance system.
  - All merchandise entering the country during a benchmark year should be included; selection of customs procedures must avoid double counting.
  - The created file should include:
    1. country of provenance;
    2. import date;
    3. national HS and subdivision code up to the most detailed level used by the country (for example, HS10);
    4. the customs procedure with an additional code;
    5. the FOB invoice amount in local currency;
    6. net weight, quantity, and additional units;
    7. total duties and taxes paid for goods that are consumed directly and indirectly;
    8. the cumulative taxation rate.
  - Initial aggregation for comparison: HS6 level; thereafter, return to most disaggregated data for verification strategy.
  - Import data used are customs clearance import data recorded after any potential adjustments by customs inspectors — indicating "fraud that remains to be addressed" (fraud not yet detected or detected but not recorded due to potential collusion).
  - Legal framework: administrations may conduct ex post verification several years after clearance or introduction.
- Export data (external):
  - Ideally come directly from partner countries’ customs information systems, but global exchange mechanisms are not yet universal.
  - Usable export "mirror" data currently come from the Comtrade database (UNCTAD).
    - Data are FOB values expressed in thousands of US dollars and weights/quantities.
    - Data are at HS six-digit subheadings (HS6), the maximum harmonized level worldwide.
  - Drawbacks of Comtrade:
    - Data compilation is time-consuming; comprehensive data for the past year require waiting at least one full year.
    - Some countries do not submit data to UNCTAD; such countries must be identified and excluded from mirror comparisons to avoid artificial discrepancies.
  - The file indicating which countries have submitted exports, imports, re-exports, and re-imports is available through WITS; for discrepancies, "gross export" = "export" + "re-export" should be used.
- Extracting mirror data in WITS:
  - A step-by-step approach is required; Annex 1 describes the seven steps.
  - Users should identify and drop countries that do not submit export data to UNCTAD from the internal import database before calculating discrepancies.
- Reconciling export data from WITS with customs import data:
  - Create a working file (Excel) and follow multi-step merging precautions; the note recommends 20 steps to prevent data loss and distorted discrepancy calculations.

*Source: tnmea2023005 - 9. The application of mirror analysis can be a catalyst for the development of the data analysis function*

### 1. Open the relevant data extracted from WITS.

### tnmea2023005 - 1. Open the relevant data extracted from WITS

### Export database: extraction and preparation
- Steps to extract and retain only necessary variables from WITS:
  - Keep HS6 with its description, the exporter name, its associated code (three-digit ISO code), the value of gross export, and weight.
  - Rename key variables to harmonize with the import database:
    - “Product Code” → “HS6”
    - “ProductDescription” → “HS6ProductDescription”
    - “ReporterName” → “ExporterName”
    - “ReporterISO3” → “ExporterCode”
    - “Netweight” → “NetWeightExport”
  - Convert gross export value into local currency using the average exchange rate for the year (exchange rate source: central bank).
  - If customs uses a two-digit exporter code, convert the three-digit code to a two-digit code to harmonize.
  - Sort by ExporterCode/HS6 before merging.
  - Save the prepared export database ready for merging.
- Procedural checklist (explicit steps from source):
  - 1. Open the relevant data extracted from WITS.
  - 2. Keep only the columns necessary for mirror gaps.
  - 3. Rename key variables for merging.
  - 4. Convert gross export value to local currency using the year average exchange rate.
  - 5. Convert 3-digit exporter codes to 2-digit if required.
  - 6. Sort by ExporterCode/HS6.
  - 7. Save the export database.

### Import database: extraction and preparation
- Core extraction and cleaning steps:
  - 8. Open import data from customs (detailed HS level, procedures/codes, origin/provenance, declarant, importer, FOB value, net weight, total duties and taxes paid, total taxation rate). Keep an original copy for investigations.
  - 9. If last country of consignment is missing, replace with country of origin.
  - 10. Delete partner countries that do not indicate exports in UN Comtrade.
  - 11. Select only regime codes validated for analysis.
  - 12. Keep only columns necessary for mirror gaps: last country of consignment code, HS code (HS8/HS10/HS12 as available), net weight, FOB and CIF values.
  - 13. Create HS6 corresponding to HS code and aggregate information by HS6 and last country of consignment.
  - 14. Rename variables to harmonize with export database:
    - last country of consignment code → “ExporterCode”
    - “FOBValue” → “ImportFOB”
    - “CIFValue” → “ImportCIF”
    - “NetWT” → “NetWeightImport”
  - 15. Sort data by ExporterCode/HS6 before merging.

### Merge databases and finalization
- Merge procedure:
  - 16. Combine WITS (export) file and customs (import) file using HS6 and last country of consignment (ExporterCode).
  - 17. Fill missing data in “HS6 product description” and “Exporter Name” columns (these originate from the export database and may be missing for import-only lines).
  - 18. Create HS4 and HS2 corresponding to HS6 and add HS4 and HS2 product descriptions.
  - 19. Save the final merged database.

### Calculate gaps (M–X and M/X)
- 20. Calculate:
  - Absolute gaps: M–X for values and weights.
  - Relative gaps: M/X for values and weights.
- Expected standard file format: columns for HS position; Import Value declared in importing country (local currency unit); Export Value declared by partner countries (local currency unit); M–X Discrepancy on Values (local currency unit); M/X in Value; Import Declared Weight (kg); Export Weight declared by partner countries (kg); M–X Discrepancy on Weight (kg); M/X in Weight; and the ratio (1)/(2).
- Note: Some ratios M/X cannot be computed when X = 0; values may be blank in that case.

### Types of situations revealed by mirror analysis
- Three possible situations when confronting import data with partner exports:
  - Matching flows: partner country’s export is reported for the declared import description.
  - Orphan imports: trade flow declared by importing country’s customs but missing in partner country (supports tariff slippage or fraud on origin).
  - Lost exports: partner country reports exports that have no corresponding import declaration in the importing country (Carrère and Grigoriou 2015).
- Classification approach:
  - Discrepancies calculated in absolute value (M–X) to classify HS positions.
  - Relative discrepancies (M/X) provide additional information on the extent of discrepancy for matching flows.
- Analytical caution:
  - Limiting analysis only to matching flows truncates results by excluding orphan imports and lost exports which often represent suspected tariff slippage.
  - Orphan imports and lost exports increase with finer disaggregation; their information content is substantial.

### Importance of disaggregated data (HS6)
- Use the most detailed disaggregation available (preferably HS6).
- Start analysis at HS2 if irregularities appear, but always drop down to HS6 to reveal potential customs fraud.
- Aggregation concealment:
  - A neutral discrepancy at chapter (HS2) level can conceal opposite situations at HS4/HS6.
  - Neutral chapter-level discrepancy (X = M) may be:
    - A clean chapter (exports match imports exactly).
    - Or a chapter where under-/overdeclarations or tariff slippages in opposite directions offset each other.
- As aggregation becomes more detailed, matches decline and investigations are more likely to succeed:
  - At HS6 level, only 65 percent and 36 percent of lines match, respectively, depending on whether analysis is solely by tariff headings or by partner-country–tariff-heading pairs.
  - Among non-matching lines, orphan imports account for 11 percent and 34 percent of total imports in value, respectively.

### Recommended method for selecting tariff headings/subheadings for investigation
- Use mirror analysis to guide chapter selection based on:
  - Value discrepancies (M–X) associated with chapters (very positive or very negative).
  - Orphan imports and lost exports associated with the chapter.
  - Weight discrepancies (priority for bulk merchandise or value tied to weight).
  - Chapter’s share in total revenue or total import volume (strategic importance).
  - Effective taxation rate of chapter (a high effective rate may be associated with negative discrepancies M<X; low rates may indicate “refuge” classifications).
  - Discrepancy between effective taxation rate and legal rate to evaluate exempted declarations.
- Stepwise disaggregation approach:
  - Select chapters to analyze using M–X and orphan/lost-export indicators.
  - Move to HS4 to identify headings likely accountable for chapter-level discrepancies (focus on M–X and orphan/lost-export patterns).
  - Proceed to HS6 to pinpoint subheadings causing discrepancies and potential tariff slippages between positions.

### Interpretation grid: chapter-level M–X discrepancy (summary)
- If M–X = 0 (neutral):
  - Possible explanations: no irregularity; or offsetting tariff slippage/irregularity between subpositions that cancels out at chapter level.
  - Example: one subposition M<X (lost exports/high tariff) and another M>X (orphan imports/low tariff).
- If M–X < 0:
  - Possible explanations: lowering of value/quantity, tariff slippage, irregularity/fraud on origin, smuggling, or lost exports.
  - Aggregation may conceal lost exports in specific subpositions.
- If M–X > 0:
  - Possible explanations: transfer pricing/capital flight (especially intragroup trade), tariff slippage toward lower-tariff positions, or orphan imports aggregated with matching flows.
  - Aggregation can generate positive discrepancy by adding orphan imports to matching flows.

### Empirical examples and observed patterns from illustrations in the source
- Chapter-specific patterns:
  - Chapter 30 (pharmaceuticals): positive M–X discrepancies are usually observed; taxation of medication is usually low; tariff slippage mainly toward cosmetics; a substantial positive discrepancy in declared values is largely explained by subheading 300410.
  - Chapter 52 (cotton, yarns, fabrics): M–X discrepancy often negative; discrepancies in value align with weight discrepancies; most discrepancy comes from position 520852.
  - Chapter 54 (manmade filaments and yarns): negative M–X discrepancies observed in six subheadings; three subheadings (540249, 540753, 540761) do not appear in import declarations yet are reported by partners — representing lost exports totaling $75 million (FOB value).
- Matching/orphan/lost shares by aggregation (Figure 1 summary):
  - Matching flows, orphan imports, and lost exports vary by aggregation level (HS2, HS4, HS6) and by whether partner-country pairing is considered.
  - Example percentages:
    - At HS6, matching lines: 65 percent (by tariff heading) and 36 percent (by partner-tariff-heading pairs).
    - Orphan imports among non-matching lines: 11 percent and 34 percent of total imports in value, respectively.

*Source: tnmea2023005 - 1. Open the relevant data extracted from WITS.*

### Chapter  3  consists  of  fish  and  shellfish.  This  chapter  contains  high  M–X  positive  discrepancies.  Weight

### tnmea2023005 - Chapter 3 consists of fish and shellfish. This chapter contains high M–X positive discrepancies. Weight

### Case studies and key numeric findings
- Table 6. Case Study 2: Chapter 52. Cotton, including Yarns and Fabrics
  - HS2 52−390−55 .143.9%
  - HS4 5208−395−57.342.8%
  - HS6 520839−55−5.246.2% 65%
  - 520852−310−50.44 0 .1% 60%
  - Source: Based on hypothetical data.

- Table 7. Case Study 3: Chapter 54. Manmade Filaments and Yarns
  - HS2 54−99−31.941. 2%
  - HS4 5402−12 . 2−2.339. 2%
  - 5407−116−28. 242.7%
  - HS6 54024918.2
  - 540752−16.8−2.94 6 .1% 50%
  - 54075343.9
  - 54 076124.3
  - 54 0769−21. 2−7.14 6 .1% 50%
  - Source: Based on hypothetical data.

- Table 8. Case Study 4: Chapter 3. Fish and Shellfish
  - HS2 03 42.258.211. 5 %
  - HS4 0302 39. 843.711. 5 %
  - 0303 5.514.911. 5 %
  - HS6 0303 6912. 315.811. 5 % 11. 5 %
  - 030219 39.911. 5 % 11. 5 %
  - Note: Orphan imports present for tariff position 030219 because no partner countries declared exports to the import country.
  - Source: Based on hypothetical data.

### Sorting the Gaps (mirror-analysis triage)
- Discrepancies in mirror data do not necessarily indicate fraud; multiple explanations exist and discrepancies may accumulate or cancel.
- Legal constraint: a customs offence must be demonstrated with supporting evidence under national customs legislation; statistical results alone are a priori excluded as proof.
- Administrative constraint: high initial volume of discrepancies requires sorting to prioritize cases for verification due to workload and limited resources.
- Objectives of sorting:
  - Assess likelihood of fraud and its effect on revenue and regulatory compliance.
  - Identify discrepancies linked to other risk criteria (e.g., repeat offenders, inconsistent origin).
  - Detect small but persistent discrepancies that may indicate systemic irregularities.
- Outcome of sorting: prepare dossiers with likely fraud scenarios, recommendations for action, and suggested customs units for verifications.

### Examination of past suspect operations (postclearance audit and investigations)
- Postclearance audit unit conducts audits according to customs legislation (customs value, rules of origin, classification in the HS).
- Customs generally have the right of access to require importers and third parties to provide documents related to operations being verified.
- Mirror discrepancies justify official administrative requests to the exporting country's customs for explanations and documents.
- Customs investigation service is mobilized when dossiers suggest smuggling or imports/exports not subjected to customs formalities.
- Compliance promotion is a priority: recover evaded duties and taxes, apply proportionate penalties, and classify involved parties as high-risk for increased controls.
- In the absence of detected infringement after verification, verified importers should be placed in the low-risk segment and benefit from reduced controls and facilitation.

### Preventative action for current or future imports
- Immediate preventive measures at customs clearance are recommended when fraud is probable and likely to recur.
  - Incorporate selection criteria in the customs processing system to target new declarations with characteristics similar to past suspicious ones.
  - Use physical inspection and weighing before customs clearance when false declaration of quantities is suspected.
- Dynamic risk analysis systems should target:
  1. new transactions,
  2. a randomly selected percentage of declarations,
  3. declarations automatically selected by probability of fraud,
  4. alerts manually added by customs (suspicious mirror data discrepancies fall into category 4).
- Caution: avoid clogging selectivity systems or overburdening inspectors with broad or insufficiently founded selection criteria.
- Where automated risk modules are absent, mirror data can refine selection criteria that are often excessively broad, stable, and predictable.

### Other potential uses of mirror-analysis results
- Rule or procedure changes: revise criteria or procedures (e.g., duty/tax exemptions, suspension regimes, oversight of customs agents) when they routinely lead to abuses.
- Estimation of missing customs revenues and strategic risk analysis:
  - Sorted and verified mirror results can help reconstruct gaps between collected and potential revenue, identify affected sectors, and update enforcement priorities.
- Amendment and harmonization of customs/statistical practices:
  - Differences in customs practices may be abnormal and require correction; convergence of practices aids trade facilitation and reliable trade statistics.
- Additional uses:
  - Evaluation of customs performance: define performance indicators linking detected fraud and mirror-analysis revelations (Cariolle and others (2019) example cited).
  - Customs knowledge and capacity building: compile external data on main imported products’ values to assess declared values.
  - Instrument for enhanced cooperation: consider routine exchange of import/export flow data among customs administrations; useful within customs unions to ensure consistent implementation of common legal frameworks.

### Ownership by customs and suggested institutional framework
- Establish a permanent administrative structure dedicated to mirror data analysis (a "Mirror Data Analysis Unit").
  - Recommended size: "five or six officers".
  - Composition: staff with data-analysis skills supported by intelligence analysts and investigators.
  - Integration: unit should be part of a broader customs data-analysis structure.
- Core missions:
  - Collection of data and identification of discrepancies (autonomous, data-analysis driven).
  - Gap analysis and sorting (tactical intelligence input required but data analysis dominant).
- Functional links:
  - Upstream: units holding information on fraud mechanisms and suspicions (intelligence, investigations, postclearance control).
  - Downstream: postclearance control for audit of past operations; risk management team for selectivity in customs clearance.
- In low-capacity administrations:
  - Data analysis is the dominant component; building data-analysis capacity is generally easier than building intelligence functions.
  - Positioning the Mirror Data Analysis Unit within data analysis is preferable.

### Automation, IT integration, and longer-term reforms
- Automation of mirror data analysis is technically feasible and consists of four steps:
  1. automatic loading of Comtrade data,
  2. extraction of data from the transactional database of the customs system,
  3. comparison of the two databases,
  4. gap analysis and production of mirror analysis results.
- Potential catalytic role: the Mirror Data Analysis Unit could lead to establishment of a full-fledged Statistical Monitoring and Data Processing division.
  - Recommendation: set up a high-level committee to oversee development of both mirror-analysis and statistical/data-processing projects.
- Additional tasks for a statistical monitoring and data-processing division (beyond mirror analysis) include:
  1. searching the customs system database to identify trends and anomalies;
  2. automated cross-checking, particularly with the tax authorities;
  3. continuing modernization of risk management systems for selectivity in customs clearance controls;
  4. monitoring compliance with procedures, including undischarged operations and arrears;
  5. producing quantitative elements for dashboards and reports to authorities;
  - The division should also be responsible for improving the quality of foreign trade statistics, addressing issues from special regimes such as free zones and processing under customs supervision.

*Source: https://www.imf.org/-/media/files/publications/tnm/2023/english/tnmea2023005.pdf*

### Annex 1. Seven Steps for Extracting

### Annex 1. Seven Steps for Extracting

### Seven-step procedure for extracting mirror data in WITS
- Step 1: Connect to the following address: https://wits.worldbank.org/WITS/WITS/Restricted/Login.aspx.
- Step 2: Register to obtain a login.
- Step 3: Make a query (“ADVANCED QUERY”) and select “Trade Data (UN Comtrade).”
- Step 4: Create a “New Query.” Define a “Query Name,” and add a “Quick Description” of the query. Then proceed.
- Step 5: Indicate the query:
  - “Reporters” are the countries whose exports are going to the country being studied. The “Reporters” are the countries that reported their exports in UN Comtrade. Select all countries in the country list (>) and proceed.
  - In “Products,” indicate (1) in “Nomenclature,” the HS used (for example, HS 2017); (2) the “Level of data disaggregation” by choosing Sub-Heading (all 6-digit HS codes); and (3) in “Clusters,” select (>) All3 Sub-Heading (all 6-digit HS codes). Then proceed.
  - “Partners” is the importing country; thus, the country being studied (for example, Kenya). You also must choose the benchmark year in “Year.”
  - In “Trade Flow,” select “Gross Export,” “Export,” and “Re-Export.” “Gross Export” equals “Export” plus “Re-Export.” In the UN statistics system (https://unstats.un.org/unsd/tradekb/Knowledgebase/Reexports-and-Reimports), re-exports are goods that are first imported into a country and then exported by that same country to another country without any processing. The UN statistics system identifies them for analysis, but they must be recorded as exports from the country. Thus, “Gross Export” must be used to calculate the discrepancies in mirror analysis.
- Step 6: Submit the query and check the status of your submitted query.
- Step 7: When the status is “Completed,” download the data. Several data extraction formats are possible.

### Recommended file formats and data handling
- For large files, Stata is the most suitable format.
- With Stata, it is easier to merge the mirror data file (WITS) with the customs data of the country being studied.
- Many administrations do not have Stata. This work can be done with Microsoft Access; it can also be done with Microsoft Excel, but with greater difficulty.
- Excel can save the first 1,048,576 rows; any remaining will be truncated.

### Extraction settings and column selection guidance
- Initially, extract all available data (see “selected Columns” in the following figure) to avoid having to go back to WITS afterward, if a more detailed analysis of the discrepancies is needed.
- Remember to fill in “Pivot Header” and “Pivot Data”; otherwise, it will be impossible to perform the extraction.
- To have a file that is easy to handle with all the information in columns:
  - Choose “Trade Flow Name” for “Pivot Header”
  - Choose “Trade Value” for “Pivot Data”
- To put the columns in order, place them in the desired order in “Selected Columns.”
- You can add columns in selected columns from available columns.
- The result of the extraction to Excel and Stata must be in the format shown here.

*The Use of Mirror Data by Customs Administrations: From Principles to Practice, TNM/2023/05*

---


_Source: https://www.imf.org/-/media/files/publications/tnm/2023/english/tnmea2023005.pdf_
