Contribution to change of a ratio with 3 terms I have a micro dataset of firms' financial liabilities for 15 years. I would like to plot the contributions to change in leverage, decomposing the single contribution of bank loans, bonds and equity variations.
Leverage is built as:

Leverage=(Loans+Bonds)/(Loans+Bonds+Equity)


Therefore contributions to growth are positive if financial debt (Bank Loans or Bonds) increases or if its sum with capital decreases and vice versa.

I would be able to decompose with logarithm a simple ratio a/b but I have no clue on how to do it with 3 components. Any idea? Thanks
Suppose we want to find the contributions of the variables to the given function:

$$f(x,y)= {x\over{y}}$$

To find the growth rates of the given variables first take the logarithm of the function $f(x,y)$:
$$ln(f(x,y))=ln\left({x\over{y}}\right)=ln(x)-ln(y)$$ 

And then take the partial derivative of the variable you would like to analyze:  

$${\partial ln\left({x\over{y}}\right)\over{\partial x}}={\dot{x}\over{x}}$$

$${\partial ln \left({x \over{y}} \right)\over{\partial y}}=-{\dot{y}\over{y}}$$

Where $\dot{x}$ and $\dot{y}$ are the derivatives of $x$ and $y$ respectively

Thus in your case if you would like to find the contributions to growth to leverage you can simply do the same thing as above. 

i.e.

$$\mathfrak{L}={{l+b}\over{l+b+e}}$$

Where:

$\mathfrak{L}=$ leverage

$l=$ loans

$b=$ bonds

$e=$ equity

Thus 

$$ln \left( \mathfrak{L} \right)= ln(l+b) -ln(l+b+e)$$

you can thus find the contributions to growth by the variables involved by taking the partial derivative of the variable you wish to examine. 

Hope this is helpful!!