  Why do companies choose particular capital structures? A compelling answer to
this question remains elusive despite extensive research. In this article, we
use double machine learning to examine the heterogeneous causal effect of
credit ratings on leverage. Taking advantage of the flexibility of random
forests within the double machine learning framework, we model the relationship
between variables associated with leverage and credit ratings without imposing
strong assumptions about their functional form. This approach also allows for
data-driven variable selection from a large set of individual company
characteristics, supporting valid causal inference. We report three findings:
First, credit ratings causally affect the leverage ratio. Having a rating, as
opposed to having none, increases leverage by approximately 7 to 9 percentage
points, or 30\% to 40\% relative to the sample mean leverage. However, this
result comes with an important caveat, captured in our second finding: the
effect is highly heterogeneous and varies depending on the specific rating. For
AAA and AA ratings, the effect is negative, reducing leverage by about 5
percentage points. For A and BBB ratings, the effect is approximately zero.
From BB ratings onwards, the effect becomes positive, exceeding 10 percentage
points. Third, contrary to what the second finding might imply at first glance,
the change from no effect to a positive effect does not occur abruptly at the
boundary between investment and speculative grade ratings. Rather, it is
gradual, taking place across the granular rating notches ("+/-") within the BBB
and BB categories.
