# Calculate WACC in R

#### 2017-07-08

The Weighted Average Cost of Capital (WACC) represents the average cost of financing a company’s debt and equity. There are two approches to calculating it, one based on the “Build-up” approach, the other on the Capital Assets Pricing Model (CAPM) approach.

$\text{WACC} = C_e \times E + C_d \times D$

where $$C_d$$ is the after-tax cost of debt, E and D the proportion of equity and debt in a firm based on market value, and $$C_e$$ is the cost of equity, which, using the CAPM approach, is calculated with:

$C_e = R_f + \beta(R_m) + R_s + \text{Risk} + \text{Firm Risk}$

where $$R_f$$ is risk-free rate, $$R_m$$ is the market premium, $$R_s$$ is the company size premium, Risk the country risk premium, Firm Risk the firm-specific risk and $$\beta$$ is a measure of the systematic risk, usually of the industry sector, in comparison to the market as a whole.

According to this paper, most companies do it wrong.

waccR make sit super easy to get the data for the US:

library(waccR)
# WACC:

wacc_usa <- wacc()
head(wacc_usa)
## # A tibble: 6 x 11
##            Industry Number_Firms  Beta Cost_Equity Equity_Debt
##               <chr>        <dbl> <dbl>       <dbl>       <dbl>
## 1       Advertising           41  1.36       10.21       62.53
## 2 Aerospace/Defense           96  1.07        8.56       81.18
## 3     Air Transport           18  1.12        8.83       61.10
## 4           Apparel           58  0.88        7.46       75.96
## 5      Auto & Truck           15  0.85        7.26       39.98
## 6   Auto      Parts           63  1.12        8.84       74.21
## # ... with 6 more variables: Std_Dev_Stock <dbl>, Cost_Debt <dbl>,
## #   Tax_Rate <dbl>, AfterTax_Cost_Debt <dbl>, Debt_Equity <dbl>,
## #   Cost_Capital <dbl>
# Industry Betas (US):

betas_usa <- betas()
head(betas_usa)
## # A tibble: 6 x 7
##            Industry Number_Firms Av_Unlevered_Beta Av_Levered_Beta
##               <chr>        <dbl>             <dbl>           <dbl>
## 1       Advertising           41              0.91            1.36
## 2 Aerospace/Defense           96              0.94            1.07
## 3     Air Transport           18              0.76            1.12
## 4           Apparel           58              0.71            0.88
## 5      Auto & Truck           15              0.38            0.85
## 6   Auto      Parts           63              0.94            1.12
## # ... with 3 more variables: Av_Corr_Market <dbl>,
## #   Total_Unlevered_Beta <dbl>, Total_Levered_Beta <dbl>