nuity relies on the credible extrapolation to the thresholds of the relation between firms’ average profits and their revenue. We show that this relation is extremely stable and linear away from the thresholds. Second, observable fixed characteristics (industry, geography, years of existence) are similar for infra-marginal firms on either sides of the thresholds. Third, the profit discontinuity at the thresholds is not driven by a few outliers but occurs at all percentiles of the profit distribution, across sectors and years. Fourth, we show that firms’ dynamic behavior mirrors the static patterns: when a firm’s revenue grows past the threshold, its reported profit margin sharply drops and remains lower in subsequent years. On the contrary, firms growing at the same rate but remaining within their tax bracket hardly change their profit margins. The returns to scale estimated from the panel data imply that the cost discontinuity is an order of magnitude too large to be explained by a reduction in economic activity and corresponds to tax evasion.

We use the estimated parameters to inform optimal corporate tax policy. First, regardless of the mechanisms driving responses, the profit elasticities of 5 and 3 severely constrain the range of desirable rates under a profit tax: rates above 17% and 25% are on the wrong side of the Laffer curve for SMEs in Costa Rica. Locally reducing the rates at the second and third tax bracket (20% and 30% respectively) is Pareto improving. Second, we use the estimated revenue and cost elasticities to characterize the optimal tax base and tax rate following the model of Best et al. (2015). We assume that the revenue elasticity corresponds to the real output elasticity and the cost elasticity to the evasion elasticity and simulate the revenue gains from broadening the base while lowering the rate, leaving total profits unchanged. We find that a reform which considerably broadens the base while lowering the rate leads to revenue collection gains of up to 80% for these firms.<sup>4</sup> Concretely two policies could be implemented: (1) moving to a turnover tax (no deductions) with a tax rate of 2.9% realizes 93% of the revenue gains (2) removing the deductibility of non-wage administrative costs would double the tax base and under a rate of 5% realizes 97% of possible gains.<sup>5</sup> Finally, we draw on rich administrative data to study if firms’ revenue responses are driven by evasion, avoidance or production decisions. In addition to corporate tax returns, we use data on audits, social security, monthly sales tax receipts and the registry of economic groups. We find evidence that for bunching firms under-reporting revenue explains part of the responses: their revenue is more likely to display inconsistencies with third-party reports and it adjusts upwards following audit threats. On the contrary, we find no evidence of specific production and avoidance responses: employment and wage bill are continuous at the thresholds in the social security data, revenue shifting across fiscal years appears limited in monthly sales receipts, and large firms do not divide into smaller ones in the group registry. Although the confidence intervals are not tight enough to reject production responses, the evidence on mechanisms supports revenue evasion and

> 4We simulate the tax system locally and note that these parameters might not apply to large firms.

> 5This is probably a lower bound since non-wage administrative costs appears very elastic in the data.

3