Session Ready
Exercise

The yield on the Moody's Baa index

In the previous chapter, you valued a bond with a $100 par value, 5% coupon rate, and 5 years to maturity. You then assumed a yield to maturity of 6% for that bond. Recall from the video that a bond's yield can be estimated by looking at the yield of comparable bonds.

In this exercise, you'll assume that the bond you valued has a Baa credit rating by Moody's and the bond will be issued on September 30, 2016. With this information, you can use the Quandl() package in R to obtain the yield of the Moody's Baa index (use the ticker "FED/RIMLPBAAR_N_M"") on September 30, 2016.

Instructions
100 XP
  • Use library() to load the Quandl package.
  • Use the Quandl() command from the Quandl package to obtain data on Moody's Baa index ("FED/RIMLPBAAR_N_M"). Save this data to baa.
  • Identify the yield for baa on September 30, 2016 using the subset() command. Save this to baa_yield.
  • Convert baa_yield from percentage to decimals using basic mathematical operations. The relevant column is saved in baa_yield$Value and needs to be divided by 100.
  • Finally, view baa_yield.